relaton-nist 1.14.9 → 1.16.1

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: d70d5c4814d320a0e7de37ffa6c87f70303132fc93a667e1ea7397cda9e3b2cd
4
- data.tar.gz: 4ac72228dfae2aeff749b90765235c374385647e16746d6efafc43ce3a86a0d6
3
+ metadata.gz: d8ff9f2caaaa9d1efff52b09cacc12abc9131479dec2ca8e2b45bcd7b6e5b599
4
+ data.tar.gz: c06dcf22be9ebb55652d5657cefa673e02c1a1175a212c4e79fd875f50b4927e
5
5
  SHA512:
6
- metadata.gz: 2128557619cae8f53fd3d80839303597d77e85065a58618a49302dd8593982ba374a7b73ab87fbe6c27661af923857f2382688990ff64acf27d2dd4607a8e0b5
7
- data.tar.gz: 8a909befb6b35b64b9f48cbcbcbef0a9ef42f336709a9a628844bf29ac94266ba466067ea3636c57e92e8c5e789b9b65cbc7317941697e288ae65a7a619da55f
6
+ metadata.gz: '04678b5942585f163ab151b15900f796d263b1d99c288377ba5d8310116815dbda0042aa2f0dc93c37428e08bd9f5853408e8a735cda7ef40cd86d89f6f8ece5'
7
+ data.tar.gz: b87900c9b522933fac16ea7cb59be00b73161749b5d313648b627d5fa3f14488705f1f836fdeba452ea7b8cb6b4bf30d71a40b3f109b9d8071d14ee1c1c15e44
data/grammars/biblio.rng CHANGED
@@ -1283,7 +1283,7 @@
1283
1283
  <value>mergedInto</value>
1284
1284
  <value>splits</value>
1285
1285
  <value>splitInto</value>
1286
- <value>instance</value>
1286
+ <value>instanceOf</value>
1287
1287
  <value>hasInstance</value>
1288
1288
  <value>exemplarOf</value>
1289
1289
  <value>hasExemplar</value>
@@ -10,12 +10,14 @@ module RelatonNist
10
10
  "hasTranslation" => "hasTranslation",
11
11
  "isTranslationOf" => "translatedFrom",
12
12
  "hasPreprint" => "hasReprint",
13
- "isPreprintOf" => "reprintOf",
13
+ "isPreprintOf" => "hasDraft",
14
14
  "isSupplementTo" => "complements",
15
15
  "isPartOf" => "partOf",
16
16
  "hasPart" => "hasPart",
17
17
  }.freeze
18
+
18
19
  URL = "https://raw.githubusercontent.com/usnistgov/NIST-Tech-Pubs/nist-pages/xml/allrecords.xml"
20
+ NS = "http://www.crossref.org/relations.xsd"
19
21
 
20
22
  def initialize(output, format)
21
23
  @output = output
@@ -107,10 +109,9 @@ module RelatonNist
107
109
 
108
110
  # @param doc [Nokogiri::XML::Element]
109
111
  # @return [Array<Hash>]
110
- def fetch_relation(doc) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
111
- ns = "http://www.crossref.org/relations.xsd"
112
- doc.xpath("./ns:program/ns:related_item", ns: ns).map do |rel|
113
- rdoi = rel.at_xpath("ns:intra_work_relation|ns:inter_work_relation", ns: ns)
112
+ def fetch_relation(doc) # rubocop:disable Metrics/AbcSize
113
+ doc.xpath("./ns:program/ns:related_item", ns: NS).map do |rel|
114
+ rdoi = rel.at_xpath("ns:intra_work_relation|ns:inter_work_relation", ns: NS)
114
115
  id = rdoi.text.split("/")[1..].join("/").gsub(".", " ")
115
116
  fref = RelatonBib::FormattedRef.new content: id
116
117
  docid = RelatonBib::DocumentIdentifier.new(type: "NIST", id: id, primary: true)
@@ -121,6 +122,13 @@ module RelatonNist
121
122
  end
122
123
  end
123
124
 
125
+ def fetch_status(doc)
126
+ s = doc.at("./ns:program/ns:related_item/ns:*[@relationship-type='isPreprintOf']", ns: NS)
127
+ return unless s
128
+
129
+ RelatonBib::DocumentStatus.new stage: "preprint"
130
+ end
131
+
124
132
  # @param doc [Nokogiri::XML::Element]
125
133
  # @return [Array<RelatonBib::TypedUri>]
126
134
  def fetch_link(doc)
@@ -323,7 +331,7 @@ module RelatonNist
323
331
  title: fetch_title(doc), link: fetch_link(doc), abstract: fetch_abstract(doc),
324
332
  date: fetch_date(doc), edition: fetch_edition(doc),
325
333
  contributor: fetch_contributor(doc), relation: fetch_relation(doc),
326
- place: fetch_place(doc), series: fetch_series(doc),
334
+ docstatus: fetch_status(doc), place: fetch_place(doc), series: fetch_series(doc),
327
335
  language: [doc["language"]], script: ["Latn"], doctype: "standard"
328
336
  )
329
337
  write_file item
@@ -1,3 +1,3 @@
1
1
  module RelatonNist
2
- VERSION = "1.14.9".freeze
2
+ VERSION = "1.16.1".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.14.0"
26
+ spec.add_dependency "relaton-bib", "~> 1.16.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.14.9
4
+ version: 1.16.1
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-08-19 00:00:00.000000000 Z
11
+ date: 2023-09-06 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.14.0
19
+ version: 1.16.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.14.0
26
+ version: 1.16.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: relaton-index
29
29
  requirement: !ruby/object:Gem::Requirement