relaton-nist 1.16.4 → 1.17.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9584f82c13f12da662266b2de0e11eb37241a6b3c4994d28720af44bdb713632
4
- data.tar.gz: 1d14d47f043644e96cd42a8419117e12111623e5e80a7a2cb37ac6c1420d37c1
3
+ metadata.gz: 4dcfa351621f17ad754376d1c7d3b593fdfda7bb1fdd91624cb357f1655d2eed
4
+ data.tar.gz: b4d12a7e12b1c8356683e457904f571133fe353e74b30ff012664d8f45f88dad
5
5
  SHA512:
6
- metadata.gz: 1d86cd19ea38a1743044ce99e28c6c5c0adc4805d5c45d6145ff4f724b10a9f9115a495cd226514fbd66e2213dce3ba807baddf3275528ae438917c36f3784a8
7
- data.tar.gz: 0c8f579f4b9eca0402d1a28c986ad188d72b2dac57a8f4cc92d18a17ea235d7fe7ebd03a3f38dcd17e91496adc595ce347b8a1c73f449d48008e54655c5ce9e1
6
+ metadata.gz: 77bf2aabe8e5be940d974da17cf4e07433ced3b2b7eae49a9930087b46b5f4fca80dc4f4771f93922adb5c8eb5bca2a0ff124b5a6c6d1e847a08280a8a369ea1
7
+ data.tar.gz: 9ed7ce8b419bfefcb6d3c5ee4034720e7fc24220e392a7a2d5edd5f6b12ffa5dad459f14c4fe54920f9f5468768357cdfa10778580fc0811153c5f30493496f7
data/README.adoc CHANGED
@@ -103,7 +103,7 @@ item = hit_collection[0].fetch
103
103
  [source,ruby]
104
104
  ----
105
105
  item.to_xml
106
- => "<bibitem id="NISTIR8200" type="standard" schema-version="v1.2.4">
106
+ => "<bibitem id="NISTIR8200" type="standard" schema-version="v1.2.5">
107
107
  <fetched>2023-10-16</fetched>
108
108
  <title format="text/plain" language="en" script="Latn">Interagency report on the status of international cybersecurity standardization for the internet of things (IoT)</title>
109
109
  ...
@@ -113,7 +113,7 @@ With argument `bibdata: true` it outputs XML wrapped by `bibdata` element and ad
113
113
  [source,ruby]
114
114
  ----
115
115
  item.to_xml bibdata: true
116
- => "<bibdata type="standard" schema-version="v1.2.4">
116
+ => "<bibdata type="standard" schema-version="v1.2.5">
117
117
  <fetched>2023-10-16</fetched>
118
118
  <title format="text/plain" language="en" script="Latn">Interagency report on the status of international cybersecurity standardization for the internet of things (IoT)</title>
119
119
  ...
@@ -346,6 +346,8 @@
346
346
  <ref name="keyword"/>
347
347
  <ref name="xref"/>
348
348
  <ref name="hyperlink"/>
349
+ <ref name="index"/>
350
+ <ref name="index-xref"/>
349
351
  </choice>
350
352
  </oneOrMore>
351
353
  </element>
@@ -623,6 +625,8 @@
623
625
  <ref name="eref"/>
624
626
  <ref name="xref"/>
625
627
  <ref name="hyperlink"/>
628
+ <ref name="index"/>
629
+ <ref name="index-xref"/>
626
630
  </choice>
627
631
  </zeroOrMore>
628
632
  </element>
@@ -636,6 +640,8 @@
636
640
  <ref name="eref"/>
637
641
  <ref name="xref"/>
638
642
  <ref name="hyperlink"/>
643
+ <ref name="index"/>
644
+ <ref name="index-xref"/>
639
645
  </choice>
640
646
  </zeroOrMore>
641
647
  </element>
@@ -648,6 +654,8 @@
648
654
  <ref name="eref"/>
649
655
  <ref name="xref"/>
650
656
  <ref name="hyperlink"/>
657
+ <ref name="index"/>
658
+ <ref name="index-xref"/>
651
659
  </choice>
652
660
  </zeroOrMore>
653
661
  </element>
@@ -655,7 +663,11 @@
655
663
  <define name="keyword">
656
664
  <element name="keyword">
657
665
  <zeroOrMore>
658
- <ref name="PureTextElement"/>
666
+ <choice>
667
+ <ref name="PureTextElement"/>
668
+ <ref name="index"/>
669
+ <ref name="index-xref"/>
670
+ </choice>
659
671
  </zeroOrMore>
660
672
  </element>
661
673
  </define>
@@ -676,7 +688,11 @@
676
688
  <define name="strike">
677
689
  <element name="strike">
678
690
  <zeroOrMore>
679
- <ref name="PureTextElement"/>
691
+ <choice>
692
+ <ref name="PureTextElement"/>
693
+ <ref name="index"/>
694
+ <ref name="index-xref"/>
695
+ </choice>
680
696
  </zeroOrMore>
681
697
  </element>
682
698
  </define>
data/grammars/biblio.rng CHANGED
@@ -942,6 +942,7 @@
942
942
  <value>obsoleted</value>
943
943
  <value>confirmed</value>
944
944
  <value>updated</value>
945
+ <value>corrected</value>
945
946
  <value>issued</value>
946
947
  <value>transmitted</value>
947
948
  <value>copied</value>
@@ -1,49 +1,50 @@
1
1
  module RelatonNist
2
- class HashConverter < RelatonBib::HashConverter
3
- class << self
4
- # @override RelatonBib::HashConverter.hash_to_bib
5
- # @param args [Hash]
6
- # @param nested [TrueClass, FalseClass]
7
- # @return [Hash]
8
- def hash_to_bib(args)
9
- ret = super
10
- return if ret.nil?
11
-
12
- commentperiod_hash_to_bib(ret)
13
- ret
14
- end
15
-
16
- private
17
-
18
- # @param item_hash [Hash]
19
- # @return [RelatonNist::NistBibliographicItem]
20
- def bib_item(item_hash)
21
- NistBibliographicItem.new(**item_hash)
22
- end
23
-
24
- def commentperiod_hash_to_bib(ret)
25
- return unless ret[:commentperiod]
26
-
27
- ret[:commentperiod] = CommentPeriod.new(**ret[:commentperiod])
28
- end
29
-
30
- # @param ret [Hash]
31
- def relations_hash_to_bib(ret)
32
- super
33
- return unless ret[:relation]
34
-
35
- ret[:relation] = ret[:relation].map { |r| DocumentRelation.new(**r) }
36
-
37
- # ret[:relation] = array(ret[:relation])
38
- # ret[:relation]&.each do |r|
39
- # if r[:description]
40
- # r[:description] = FormattedString.new r[:description]
41
- # end
42
- # relation_bibitem_hash_to_bib(r)
43
- # relation_locality_hash_to_bib(r)
44
- # relation_source_locality_hash_to_bib(r)
45
- # end
46
- end
2
+ module HashConverter
3
+ include RelatonBib::HashConverter
4
+ extend self
5
+
6
+ # @override RelatonBib::HashConverter.hash_to_bib
7
+ # @param args [Hash]
8
+ # @param nested [TrueClass, FalseClass]
9
+ # @return [Hash]
10
+ def hash_to_bib(args)
11
+ ret = super
12
+ return if ret.nil?
13
+
14
+ commentperiod_hash_to_bib(ret)
15
+ ret
16
+ end
17
+
18
+ private
19
+
20
+ # @param item_hash [Hash]
21
+ # @return [RelatonNist::NistBibliographicItem]
22
+ def bib_item(item_hash)
23
+ NistBibliographicItem.new(**item_hash)
24
+ end
25
+
26
+ def commentperiod_hash_to_bib(ret)
27
+ return unless ret[:commentperiod]
28
+
29
+ ret[:commentperiod] = CommentPeriod.new(**ret[:commentperiod])
30
+ end
31
+
32
+ # @param ret [Hash]
33
+ def relations_hash_to_bib(ret)
34
+ super
35
+ return unless ret[:relation]
36
+
37
+ ret[:relation] = ret[:relation].map { |r| DocumentRelation.new(**r) }
38
+
39
+ # ret[:relation] = array(ret[:relation])
40
+ # ret[:relation]&.each do |r|
41
+ # if r[:description]
42
+ # r[:description] = FormattedString.new r[:description]
43
+ # end
44
+ # relation_bibitem_hash_to_bib(r)
45
+ # relation_locality_hash_to_bib(r)
46
+ # relation_source_locality_hash_to_bib(r)
47
+ # end
47
48
  end
48
49
  end
49
50
  end
@@ -1,8 +1,5 @@
1
1
  module RelatonNist
2
2
  class NistBibliographicItem < RelatonBib::BibliographicItem
3
- # @return [String]
4
- attr_reader :doctype
5
-
6
3
  # @return [Array<RelatonNist::Keyword>]
7
4
  # attr_reader :keyword
8
5
 
@@ -88,7 +85,7 @@ module RelatonNist
88
85
  super date_format: :short, **opts do |b|
89
86
  if opts[:bibdata]
90
87
  ext = b.ext do
91
- b.doctype doctype if doctype
88
+ doctype&.to_xml b
92
89
  commentperiod&.to_xml b
93
90
  end
94
91
  ext["schema-version"] = ext_schema unless opts[:embedded]
@@ -32,7 +32,7 @@ module RelatonNist
32
32
  item_data[:fetched] = Date.today.to_s
33
33
  item_data[:type] = "standard"
34
34
  item_data[:title] = titles
35
- item_data[:doctype] = "standard"
35
+ item_data[:doctype] = RelatonBib::DocumentType.new(type: "standard")
36
36
 
37
37
  NistBibliographicItem.new(**item_data)
38
38
  end
@@ -12,7 +12,7 @@ module RelatonNist
12
12
  "hasPart" => "hasPart",
13
13
  }.freeze
14
14
 
15
- ATTRS = %i[docid title link abstract date edition contributor relation docstatus place series].freeze
15
+ ATTRS = %i[docid title link abstract date doctype edition contributor relation docstatus place series].freeze
16
16
  NS = "http://www.crossref.org/relations.xsd".freeze
17
17
 
18
18
  def initialize(doc, series)
@@ -41,8 +41,7 @@ module RelatonNist
41
41
  #
42
42
  def parse
43
43
  RelatonNist::NistBibliographicItem.new(
44
- type: "standard", language: [@doc["language"]], script: ["Latn"],
45
- doctype: "standard", **args
44
+ type: "standard", language: [@doc["language"]], script: ["Latn"], **args
46
45
  )
47
46
  rescue StandardError => e
48
47
  warn "Document: `#{@doc.at('doi').text}`"
@@ -135,6 +134,10 @@ module RelatonNist
135
134
  end
136
135
  end
137
136
 
137
+ def parse_doctype
138
+ RelatonBib::DocumentType.new(type: "standard")
139
+ end
140
+
138
141
  # @return [String]
139
142
  def parse_edition
140
143
  @doc.at("edition_number")&.text
@@ -1,3 +1,3 @@
1
1
  module RelatonNist
2
- VERSION = "1.16.4".freeze
2
+ VERSION = "1.17.0".freeze
3
3
  end
data/relaton_nist.gemspec CHANGED
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
23
23
  spec.require_paths = ["lib"]
24
24
  spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
25
25
 
26
- spec.add_dependency "relaton-bib", "~> 1.16.0"
26
+ spec.add_dependency "relaton-bib", "~> 1.17.0"
27
27
  spec.add_dependency "relaton-index", "~> 0.2.0"
28
28
  spec.add_dependency "rubyzip"
29
29
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-nist
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.16.4
4
+ version: 1.17.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-10-18 00:00:00.000000000 Z
11
+ date: 2023-11-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: relaton-bib
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.16.0
19
+ version: 1.17.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 1.16.0
26
+ version: 1.17.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: relaton-index
29
29
  requirement: !ruby/object:Gem::Requirement