relaton-etsi 2.0.0.pre.alpha.2 → 2.0.0.pre.alpha.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bceac3758fddfc4faeaebefed80609a5812982d623de452ce996bd7166a2e421
4
- data.tar.gz: 1acf19c11ef380345872527660fbe1d70d51c506b6e22c5e5cf920b73d9ee843
3
+ metadata.gz: 2b8880af28706d71e1ab59caa6cac16c23ef704ec7f211a4624b68c5f6a357f8
4
+ data.tar.gz: 5cd61a36948a56ba288b2558b884d871efe73f74bc31151dc71110d98d44fec2
5
5
  SHA512:
6
- metadata.gz: 4480249c0810e4029bb3c19fabc8a8101fc60b40974b907f643b97904f7084cd4b7a0ed55a3c2d9abb5bda652d2f54816035afe947fa0dcabb21d0a9e04eaa66
7
- data.tar.gz: be4182010f9be99617786853d790bdc01137d3c141c55031359812cfbf1541caf3dbc414c5b22312731c4df0f3f6a0fc83fb17c3ef5d87ccdb1bd1e03830db2b
6
+ metadata.gz: 302f6e36cc7532666fed67da1c4d047e6e37ab16f3852b605f5f7125e27a2e2f17436fb7acfb3f7212d9e0108b9123e233c7b7310ca42ee31a3c6d2e58c81962
7
+ data.tar.gz: 27958a5aa9fed21b4e72ecbe4837a8a94b5e79642f70dc1af4b0715d20af26d32579bf8f609d33d631c1d28cb7ca5c1dc39a7b1cb3a9da3b41dbc93626ce6eaa
data/README.adoc CHANGED
@@ -42,7 +42,7 @@ item = Relaton::Etsi::Bibliography.get("ETSI GS ZSM 012 V1.1.1")
42
42
  [source,ruby]
43
43
  ----
44
44
  item.to_xml
45
- => "<bibitem id="ETSIGSZSM012V111202212" schema-version="v1.4.1">
45
+ => "<bibitem id="ETSIGSZSM012V111202212" schema-version="v1.5.6">
46
46
  <fetched>2026-01-24</fetched>
47
47
  <title language="en" script="Latn">Zero-touch network and Service Management (ZSM); Enablers for Artificial Intelligence-based Network and Service Automation</title>
48
48
  <uri type="src">http://webapp.etsi.org/workprogram/Report_WorkItem.asp?WKI_ID=62010</uri>
@@ -55,14 +55,14 @@ With argument `bibdata: true` it outputs XML wrapped by `bibdata` element and ad
55
55
  [source,ruby]
56
56
  ----
57
57
  item.to_xml bibdata: true
58
- => "<bibdata schema-version="v1.4.1">
58
+ => "<bibdata schema-version="v1.5.6">
59
59
  <fetched>2026-01-24</fetched>
60
60
  <title language="en" script="Latn">Zero-touch network and Service Management (ZSM); Enablers for Artificial Intelligence-based Network and Service Automation</title>
61
61
  <uri type="src">http://webapp.etsi.org/workprogram/Report_WorkItem.asp?WKI_ID=62010</uri>
62
62
  <uri type="pdf">http://www.etsi.org/deliver/etsi_gs/ZSM/001_099/012/01.01.01_60/gs_ZSM012v010101p.pdf</uri>
63
63
  <docidentifier type="ETSI" primary="true">ETSI GS ZSM 012 V1.1.1 (2022-12)</docidentifier>
64
64
  ...
65
- <ext schema-version="v0.0.3">
65
+ <ext schema-version="v0.1.2">
66
66
  <doctype abbreviation="GS">Group Specification</doctype>
67
67
  </ext>
68
68
  </bibdata>"
@@ -187,6 +187,15 @@ Applicable to modify and delete</a:documentation>
187
187
  <a:documentation>Optional caption of this block</a:documentation>
188
188
  </attribute>
189
189
  </optional>
190
+ <optional>
191
+ <attribute name="position">
192
+ <a:documentation>For an "add" change, whether the change is added before or after the location</a:documentation>
193
+ <choice>
194
+ <value>before</value>
195
+ <value>after</value>
196
+ </choice>
197
+ </attribute>
198
+ </optional>
190
199
  <optional>
191
200
  <element name="location">
192
201
  <a:documentation>The location(s) in the original document which have undergone the change described in this block</a:documentation>
@@ -208,11 +217,15 @@ Applicable to modify and delete</a:documentation>
208
217
  </zeroOrMore>
209
218
  <optional>
210
219
  <element name="newcontent">
211
- <a:documentation>New content to be added to the document; applicable to add and modify</a:documentation>
220
+ <a:documentation>New content to be added to the document; applicable to add and modify.
221
+ Can be blocks and/or sections</a:documentation>
212
222
  <ref name="OptionalId"/>
213
223
  <zeroOrMore>
214
224
  <ref name="BasicBlock"/>
215
225
  </zeroOrMore>
226
+ <zeroOrMore>
227
+ <ref name="section"/>
228
+ </zeroOrMore>
216
229
  </element>
217
230
  </optional>
218
231
  <zeroOrMore>
data/grammars/biblio.rng CHANGED
@@ -466,11 +466,11 @@ Editorial and advisory groups are represented as consecutive subdivisions of the
466
466
  <a:documentation>Contact information for the organization, including address, phone number, and email</a:documentation>
467
467
  </ref>
468
468
  </optional>
469
- <optional>
469
+ <zeroOrMore>
470
470
  <ref name="logo">
471
471
  <a:documentation>A logo for the organization</a:documentation>
472
472
  </ref>
473
- </optional>
473
+ </zeroOrMore>
474
474
  </define>
475
475
  <define name="orgname">
476
476
  <element name="name">
@@ -502,6 +502,11 @@ Editorial and advisory groups are represented as consecutive subdivisions of the
502
502
  </define>
503
503
  <define name="logo">
504
504
  <element name="logo">
505
+ <optional>
506
+ <attribute name="type">
507
+ <a:documentation>The type of logo</a:documentation>
508
+ </attribute>
509
+ </optional>
505
510
  <ref name="image-no-id"/>
506
511
  </element>
507
512
  </define>
@@ -513,6 +518,11 @@ Editorial and advisory groups are represented as consecutive subdivisions of the
513
518
  <a:documentation>Description of what is being depicted</a:documentation>
514
519
  </attribute>
515
520
  </optional>
521
+ <optional>
522
+ <attribute name="type">
523
+ <a:documentation>Description of what kind of depiction this</a:documentation>
524
+ </attribute>
525
+ </optional>
516
526
  <zeroOrMore>
517
527
  <ref name="image-no-id">
518
528
  <a:documentation>A visual depiction of the bibliographic item</a:documentation>
@@ -690,7 +700,7 @@ Examples include GRID, LEI, CrossRef, and Ringgold</a:documentation>
690
700
  <define name="CitationType">
691
701
  <attribute name="bibitemid">
692
702
  <a:documentation>Bibliographic item that the citation applies to, referenced as the anchor of a bibliographic description</a:documentation>
693
- <data type="IDREF"/>
703
+ <ref name="IdRefType"/>
694
704
  </attribute>
695
705
  <choice>
696
706
  <zeroOrMore>
@@ -1132,11 +1142,11 @@ NOTE: This should preferably be encoded as a URI or short identifier, rather th
1132
1142
  <a:documentation>Information about how long the current description of the bibliographic item is valid for</a:documentation>
1133
1143
  </ref>
1134
1144
  </optional>
1135
- <optional>
1145
+ <zeroOrMore>
1136
1146
  <ref name="depiction">
1137
1147
  <a:documentation>Depiction of the bibliographic item, typically an image</a:documentation>
1138
1148
  </ref>
1139
- </optional>
1149
+ </zeroOrMore>
1140
1150
  </define>
1141
1151
  <define name="ReducedBibliographicItem">
1142
1152
  <a:documentation>Reduced description of a bibliographic resource, without mandatory title and docidentifier, used for document relations
@@ -1236,9 +1246,9 @@ Refer to `BibliographicItem` for definitions</a:documentation>
1236
1246
  <optional>
1237
1247
  <ref name="validity"/>
1238
1248
  </optional>
1239
- <optional>
1249
+ <zeroOrMore>
1240
1250
  <ref name="depiction"/>
1241
- </optional>
1251
+ </zeroOrMore>
1242
1252
  </define>
1243
1253
  <define name="btitle">
1244
1254
  <a:documentation>A title of a bibliographic item, associated with a type of title</a:documentation>
@@ -1296,17 +1306,17 @@ for which this claim of validity is made, if applicable</a:documentation>
1296
1306
  </define>
1297
1307
  <define name="validityBegins">
1298
1308
  <element name="validityBegins">
1299
- <ref name="ISO8601Date"/>
1309
+ <ref name="ISO8601DateTime"/>
1300
1310
  </element>
1301
1311
  </define>
1302
1312
  <define name="validityEnds">
1303
1313
  <element name="validityEnds">
1304
- <ref name="ISO8601Date"/>
1314
+ <ref name="ISO8601DateTime"/>
1305
1315
  </element>
1306
1316
  </define>
1307
1317
  <define name="validityRevision">
1308
1318
  <element name="revision">
1309
- <ref name="ISO8601Date"/>
1319
+ <ref name="ISO8601DateTime"/>
1310
1320
  </element>
1311
1321
  </define>
1312
1322
  <define name="TypedTitleString">
@@ -1929,10 +1939,10 @@ Detailed in https://www.relaton.org/model/relations/</a:documentation>
1929
1939
  <value>hasAnnotation</value>
1930
1940
  <value>draftOf</value>
1931
1941
  <value>hasDraft</value>
1932
- <value>preliminaryDraftOf</value>
1933
- <value>hasPreliminaryDraft</value>
1934
- <value>revisionDraftOf</value>
1935
- <value>hasRevisionDraft</value>
1942
+ <value>predecessorDraftOf</value>
1943
+ <value>hasPredecessorDraft</value>
1944
+ <value>successorDraftOf</value>
1945
+ <value>hasSuccessorDraft</value>
1936
1946
  <value>editionOf</value>
1937
1947
  <value>hasEdition</value>
1938
1948
  <value>updates</value>
@@ -2053,13 +2063,13 @@ provided that it is not the entire bibliographic item that is so related</a:docu
2053
2063
  <ref name="LocalizedString"/>
2054
2064
  </element>
2055
2065
  </optional>
2056
- <oneOrMore>
2066
+ <zeroOrMore>
2057
2067
  <element name="taxon">
2058
2068
  <a:documentation>The keywords as a hierarchical taxonomy. For example, the sequence of `taxon` elements
2059
2069
  `pump`, `centrifugal pump`, `line shaft pump` represents a taxonomic classification</a:documentation>
2060
2070
  <ref name="LocalizedString"/>
2061
2071
  </element>
2062
- </oneOrMore>
2072
+ </zeroOrMore>
2063
2073
  <zeroOrMore>
2064
2074
  <ref name="vocabid">
2065
2075
  <a:documentation>Identifiers for the keyword as a controlled vocabulary</a:documentation>
@@ -1,25 +1,6 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <grammar xmlns="http://relaxng.org/ns/structure/1.0">
3
3
  <include href="biblio-standoc.rng">
4
- <define name="BibDataExtensionType">
5
- <optional>
6
- <attribute name="schema-version"/>
7
- </optional>
8
- <ref name="doctype"/>
9
- <optional>
10
- <ref name="docsubtype"/>
11
- </optional>
12
- <ref name="marker"/>
13
- <zeroOrMore>
14
- <ref name="frequency"/>
15
- </zeroOrMore>
16
- <zeroOrMore>
17
- <ref name="mandate"/>
18
- </zeroOrMore>
19
- <optional>
20
- <ref name="custom-collection"/>
21
- </optional>
22
- </define>
23
4
  <define name="status">
24
5
  <element name="status">
25
6
  <ref name="stage"/>
@@ -60,6 +41,18 @@
60
41
  </choice>
61
42
  </define>
62
43
  </include>
44
+ <define name="BibDataExtensionType" combine="interleave">
45
+ <ref name="marker"/>
46
+ <zeroOrMore>
47
+ <ref name="frequency"/>
48
+ </zeroOrMore>
49
+ <zeroOrMore>
50
+ <ref name="mandate"/>
51
+ </zeroOrMore>
52
+ <optional>
53
+ <ref name="custom-collection"/>
54
+ </optional>
55
+ </define>
63
56
  <define name="StageType">
64
57
  <choice>
65
58
  <value>EN approval</value>
@@ -18,6 +18,10 @@ module Relaton
18
18
  @index ||= Relaton::Index.find_or_create :etsi, file: INDEX_FILE
19
19
  end
20
20
 
21
+ def log_error(msg)
22
+ Util.error msg
23
+ end
24
+
21
25
  #
22
26
  # Fetch all ETSI documents from the ETSI website.
23
27
  #
@@ -30,9 +34,10 @@ module Relaton
30
34
  url = format(SOURCEURL, date: date, timestamp: timestamp)
31
35
  csv = fetch_with_retry(url)
32
36
  CSV.parse(csv, headers: true, col_sep: ";", skip_lines: /sep=;/).each do |row|
33
- save DataParser.new(row).parse
37
+ save DataParser.new(row, @errors).parse
34
38
  end
35
39
  index.save
40
+ report_errors
36
41
  end
37
42
 
38
43
  NETWORK_ERRORS = [
@@ -63,11 +68,6 @@ module Relaton
63
68
  index.add_or_update id, file
64
69
  end
65
70
 
66
- def output_file(docid)
67
- filename = docid.gsub("/", "-").gsub(/[\s.]/, "_").gsub(/[()]/, "")
68
- File.join @output, "#{filename}.#{@ext}"
69
- end
70
-
71
71
  def to_yaml(bib)
72
72
  bib.to_yaml
73
73
  end
@@ -7,8 +7,9 @@ module Relaton
7
7
  keyword ext abstract language script
8
8
  ].freeze
9
9
 
10
- def initialize(row)
10
+ def initialize(row, errors = {})
11
11
  @row = row
12
+ @errors = errors
12
13
  end
13
14
 
14
15
  def parse
@@ -19,11 +20,28 @@ module Relaton
19
20
  end
20
21
 
21
22
  def pubid
22
- @pubid ||= PubId.parse(@row["ETSI deliverable"])
23
+ return @pubid if defined?(@pubid)
24
+
25
+ unless @row["ETSI deliverable"]
26
+ @errors[:pubid] &&= true
27
+ @pubid = nil
28
+ return @pubid
29
+ end
30
+
31
+ @errors[:pubid] &&= false
32
+ @pubid = PubId.parse(@row["ETSI deliverable"])
23
33
  end
24
34
 
25
35
  def title
26
- [Bib::Title.new(content: @row["title"], language: "en", script: "Latn")]
36
+ result = if @row["title"]
37
+ [Bib::Title.new(
38
+ content: @row["title"], language: "en", script: "Latn",
39
+ )]
40
+ else
41
+ []
42
+ end
43
+ @errors[:title] &&= result.empty?
44
+ result
27
45
  end
28
46
 
29
47
  def docnumber
@@ -32,28 +50,57 @@ module Relaton
32
50
 
33
51
  def source
34
52
  urls = []
35
- urls << Bib::Uri.new(content: @row["Details link"], type: "src")
36
- urls << Bib::Uri.new(content: @row["PDF link"], type: "pdf")
53
+ if @row["Details link"]
54
+ urls << Bib::Uri.new(content: @row["Details link"], type: "src")
55
+ end
56
+ if @row["PDF link"]
57
+ urls << Bib::Uri.new(content: @row["PDF link"], type: "pdf")
58
+ end
59
+ @errors[:source] &&= urls.empty?
60
+ urls
37
61
  end
38
62
 
39
63
  def date
40
- return [] unless pubid.date
41
-
42
- [Bib::Date.new(type: "published", at: pubid.date)]
64
+ result = if pubid&.date
65
+ [Bib::Date.new(type: "published", at: pubid.date)]
66
+ else
67
+ []
68
+ end
69
+ @errors[:date] &&= result.empty?
70
+ result
43
71
  end
44
72
 
45
73
  def docidentifier
46
- [Bib::Docidentifier.new(content: @row["ETSI deliverable"], type: "ETSI", primary: true)]
74
+ result = if @row["ETSI deliverable"]
75
+ [Bib::Docidentifier.new(
76
+ content: @row["ETSI deliverable"],
77
+ type: "ETSI",
78
+ primary: true,
79
+ )]
80
+ else
81
+ []
82
+ end
83
+ @errors[:docidentifier] &&= result.empty?
84
+ result
47
85
  end
48
86
 
49
87
  def version
50
- return [] unless pubid.version
88
+ return [] unless pubid&.version
51
89
 
52
90
  [Bib::Version.new(draft: pubid.version)]
53
91
  end
54
92
 
55
93
  def status
56
- stage = @row["Status"] == "On Approval" ? "#{pubid.type} approval" : @row["Status"]
94
+ unless @row["Status"]
95
+ @errors[:status] &&= true
96
+ return
97
+ end
98
+
99
+ stage = @row["Status"]
100
+ if stage == "On Approval"
101
+ stage = "#{pubid&.type} approval"
102
+ end
103
+ @errors[:status] &&= false
57
104
  Status.new(stage: stage)
58
105
  end
59
106
 
@@ -119,26 +166,36 @@ module Relaton
119
166
  end
120
167
 
121
168
  def keyword
122
- taxon = @row["Keywords"].split(",").map do |kw|
123
- Bib::LocalizedString.new(content: kw.strip, language: "en", script: "Latn")
169
+ unless @row["Keywords"]
170
+ @errors[:keyword] &&= true
171
+ return []
124
172
  end
125
- return [] if taxon.empty?
126
173
 
127
- [Bib::Keyword.new(taxon: taxon)]
174
+ result = @row["Keywords"].split(",").map do |kw|
175
+ Bib::Keyword.new(vocab: Bib::LocalizedString.new(content: kw.strip, language: "en", script: "Latn"))
176
+ end
177
+ @errors[:keyword] &&= result.empty?
178
+ result
128
179
  end
129
180
 
130
181
  def ext
131
- Ext.new(doctype: doctype)
182
+ Ext.new(doctype: doctype, flavor: "etsi")
132
183
  end
133
184
 
134
185
  def doctype
186
+ return unless pubid
187
+
135
188
  Doctype.create_from_abbreviation pubid.type
136
189
  end
137
190
 
138
191
  def abstract
139
- return [] unless @row["Scope"]
140
-
141
- [Bib::LocalizedMarkedUpString.new(content: @row["Scope"], language: "en", script: "Latn")]
192
+ result = if @row["Scope"]
193
+ [Bib::Abstract.new(content: @row["Scope"], language: "en", script: "Latn")]
194
+ else
195
+ []
196
+ end
197
+ @errors[:abstract] &&= result.empty?
198
+ result
142
199
  end
143
200
 
144
201
  def language
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Relaton
4
4
  module Etsi
5
- VERSION = "2.0.0-alpha.2"
5
+ VERSION = "2.0.0-alpha.3"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-etsi
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.pre.alpha.2
4
+ version: 2.0.0.pre.alpha.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
@@ -43,28 +43,28 @@ dependencies:
43
43
  requirements:
44
44
  - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: 2.0.0.pre.alpha.4
46
+ version: 2.0.0.pre.alpha.7
47
47
  type: :runtime
48
48
  prerelease: false
49
49
  version_requirements: !ruby/object:Gem::Requirement
50
50
  requirements:
51
51
  - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: 2.0.0.pre.alpha.4
53
+ version: 2.0.0.pre.alpha.7
54
54
  - !ruby/object:Gem::Dependency
55
55
  name: relaton-core
56
56
  requirement: !ruby/object:Gem::Requirement
57
57
  requirements:
58
58
  - - "~>"
59
59
  - !ruby/object:Gem::Version
60
- version: 0.0.9
60
+ version: 0.0.13
61
61
  type: :runtime
62
62
  prerelease: false
63
63
  version_requirements: !ruby/object:Gem::Requirement
64
64
  requirements:
65
65
  - - "~>"
66
66
  - !ruby/object:Gem::Version
67
- version: 0.0.9
67
+ version: 0.0.13
68
68
  - !ruby/object:Gem::Dependency
69
69
  name: relaton-index
70
70
  requirement: !ruby/object:Gem::Requirement