relaton-nist 1.11.2 → 1.11.3

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: '095a15201f14cd98e0e838767c84345b6c3963fd40a820c380e2d473d6974911'
4
- data.tar.gz: b95ac950a2c35a3f24b788544cc66e064e24abd64e0953e791a343a5a031ac82
3
+ metadata.gz: b6b0ce8787fdc41eb5b334df6e1d8f65c2bbfe6437ab8b36124d917c7549a869
4
+ data.tar.gz: d9b3bd1f467450a874ba8f9bc8d98c669a3296a0014c6083b248522bb4f6cd2a
5
5
  SHA512:
6
- metadata.gz: 49830f72fa98e99c018694f8cface13e108cfffe4de3163870e12d02a6434006fe6d48a40480041a3d2ff1a39cded6243fb0c35f07450c2429107a56890e7cc9
7
- data.tar.gz: 5d482c2805ee879b8728627b495a638b46604f6aecc898b0f75c2e8a114fc5d23d778e297cd59567b6da8375d7d011729fc5df3b39dc4eed9657c329679086ef
6
+ metadata.gz: beb5e04d0d431263d209e5172a419b940afe614888fd7a9158c360b7277d61312edf8824fef3989608a543c3bb36bd8612d1e737a07e7349d027aa9578d6c829
7
+ data.tar.gz: f46f37e146aedc51b9d91896ba38604af5bb95cc93e2d19c17e4f3894cffe5adac98fd05b176aa6830bed802b30e8163371d38caa25021742dc91fc8b0d11a10
@@ -158,20 +158,37 @@ module RelatonNist
158
158
  { entity: person, role: [{ type: p["contributor_role"] }] }
159
159
  end
160
160
  contribs + doc.xpath("publisher").map do |p|
161
- abbr = p.at("../institution/institution_acronym")&.text
162
- place = p.at("./publisher_place")
163
- cont = []
164
- if place
165
- city, state = place.text.split(", ")
166
- cont << RelatonBib::Address.new(street: [], city: city, state: state, country: "US")
167
- end
168
- org = RelatonBib::Organization.new(
169
- name: p.at("publisher_name").text, abbreviation: abbr, contact: cont,
170
- )
171
- { entity: org, role: [{ type: "publisher" }] }
161
+ { entity: create_org(p), role: [{ type: "publisher" }] }
162
+ end
163
+ end
164
+
165
+ #
166
+ # Create publisher organization
167
+ #
168
+ # @param [Nokogiri::XML::Element] pub publisher element
169
+ #
170
+ # @return [RelatonBib::Organization] publisher organization
171
+ #
172
+ def create_org(pub)
173
+ name = pub.at("publisher_name").text
174
+ abbr = pub.at("../institution[institution_name[.='#{name}']]/institution_acronym")&.text
175
+ place = pub.at("./publisher_place") ||
176
+ pub.at("../institution[institution_name[.='#{name}']]/institution_place")
177
+ cont = []
178
+ if place
179
+ city, state = place.text.split(", ")
180
+ cont << RelatonBib::Address.new(street: [], city: city, state: state, country: "US")
172
181
  end
182
+ RelatonBib::Organization.new name: name, abbreviation: abbr, contact: cont
173
183
  end
174
184
 
185
+ #
186
+ # Create affiliation organization
187
+ #
188
+ # @param [Nokogiri::XML::Element] doc affiliation element
189
+ #
190
+ # @return [Array<RelatonBib::Affiliation>] affiliation
191
+ #
175
192
  def affiliation(doc)
176
193
  doc.xpath("./institution/institution_department").map do |id|
177
194
  org = RelatonBib::Organization.new name: id.text
@@ -185,9 +202,20 @@ module RelatonNist
185
202
  doc.xpath("institution/institution_place").map(&:text)
186
203
  end
187
204
 
205
+ #
206
+ # Fetches series
207
+ #
208
+ # @param [Nokogiri::XML::Element] doc document element
209
+ #
210
+ # @return [Array<RelatonBib::Series>] series
211
+ #
188
212
  def fetch_series(doc)
189
- title = RelatonBib::TypedTitleString.new(content: "NIST")
190
- [RelatonBib::Series.new(title: title, number: pub_id(doc))]
213
+ series_path = File.expand_path("series.yaml", __dir__)
214
+ series = YAML.load_file series_path
215
+ prf, srs, = pub_id(doc).split
216
+ sname = series[srs] || srs
217
+ title = RelatonBib::TypedTitleString.new(content: "#{prf} #{sname}")
218
+ [RelatonBib::Series.new(title: title, number: "#{prf} #{srs}")]
191
219
  end
192
220
 
193
221
  #
@@ -0,0 +1,49 @@
1
+ ---
2
+ AMS: Advanced Manufacturing Series
3
+ BRPD: Basic Radio Propagation Predictions Series
4
+ BH: Building and Housing Reports
5
+ BMS: Building Materials and Structures Reports
6
+ BSS: Building Science Series
7
+ CRPL: CRPL Solar-Geophysical Data
8
+ IP: CRPL Ionospheric Predictions
9
+ CIRC: Circulars
10
+ CIS: Consumer Information Series
11
+ CS: Commercial Standards
12
+ CSM: Commercial Standards Monthly
13
+ CSWP: Cybersecurity White Papers
14
+ EAB: Economic Analysis Briefs
15
+ FIPS: Federal Information Processing Standards Publications
16
+ GCR: Grant/Contractor Reports
17
+ HB: Handbooks
18
+ HR: Hydraulic Research in the United States
19
+ IRPL: Interservice Radio Propagation Laboratory
20
+ LCIRC: Letter Circular
21
+ MONO: Monographs
22
+ MP: Miscellaneous Publications
23
+ NCSTAR: National Construction Safety Team Act Reports
24
+ NSRDS: National Standard Reference Data Series
25
+ IR: NISTIRs (Interagency/Internal Reports)
26
+ OWMWP: Office of Weights and Measures White Papers
27
+ PC: Photographic Circulars
28
+ RPT: NBS Reports
29
+ SIBS: Special Interior Ballistics Studies
30
+ SP: Special Publications (General)
31
+ SP250: 'SP 250: Calibration Services'
32
+ SP260: 'SP 260: Standard Reference Materials'
33
+ SP300: 'SP 300: Precision Measurement and Calibration'
34
+ SP400: 'SP 400: Semiconductor Measurement Technology'
35
+ SP480: 'SP 480: Law Enforcement Technology'
36
+ SP500: 'SP 500: Computer Systems Technology'
37
+ SP700: 'SP 700: Industrial Measurement Series'
38
+ SP800: 'SP 800: Computer Security Series'
39
+ SP823: 'SP 823: Integrated Services Digital Network Series'
40
+ SP960: 'SP 960: NIST Recommended Practice Guides'
41
+ SP1200: 'SP 1200: Protocols'
42
+ SP1500: 'SP 1500: Working Group Papers'
43
+ SP1800: 'SP 1800: NIST Cybersecurity Practice Guides'
44
+ SP1900: 'SP 1900: Cyber-Physical Systems'
45
+ SP2000: 'SP 2000: Standards Coordination'
46
+ SP2100: 'SP 2100: Conference Proceedings'
47
+ TIBM: Technical Information on Building Materials
48
+ TN: Technical Notes
49
+ TTB: Technology Transfer Brief
@@ -1,3 +1,3 @@
1
1
  module RelatonNist
2
- VERSION = "1.11.2".freeze
2
+ VERSION = "1.11.3".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-nist
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.11.2
4
+ version: 1.11.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
@@ -185,6 +185,7 @@ files:
185
185
  - lib/relaton_nist/nist_bibliography.rb
186
186
  - lib/relaton_nist/processor.rb
187
187
  - lib/relaton_nist/scrapper.rb
188
+ - lib/relaton_nist/series.yaml
188
189
  - lib/relaton_nist/version.rb
189
190
  - lib/relaton_nist/xml_parser.rb
190
191
  - relaton_nist.gemspec