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 +4 -4
- data/README.adoc +2 -2
- data/grammars/basicdoc.rng +18 -2
- data/grammars/biblio.rng +1 -0
- data/lib/relaton_nist/hash_converter.rb +46 -45
- data/lib/relaton_nist/nist_bibliographic_item.rb +1 -4
- data/lib/relaton_nist/scrapper.rb +1 -1
- data/lib/relaton_nist/tech_pubs_parser.rb +6 -3
- data/lib/relaton_nist/version.rb +1 -1
- data/relaton_nist.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4dcfa351621f17ad754376d1c7d3b593fdfda7bb1fdd91624cb357f1655d2eed
|
4
|
+
data.tar.gz: b4d12a7e12b1c8356683e457904f571133fe353e74b30ff012664d8f45f88dad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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.
|
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
|
...
|
data/grammars/basicdoc.rng
CHANGED
@@ -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
|
-
<
|
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
|
-
<
|
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
@@ -1,49 +1,50 @@
|
|
1
1
|
module RelatonNist
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
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
|
-
|
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
|
data/lib/relaton_nist/version.rb
CHANGED
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.
|
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.
|
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-
|
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.
|
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.
|
26
|
+
version: 1.17.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: relaton-index
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|