relaton-nist 1.16.0 → 1.16.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/relaton_nist/data_fetcher.rb +14 -6
- data/lib/relaton_nist/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d8ff9f2caaaa9d1efff52b09cacc12abc9131479dec2ca8e2b45bcd7b6e5b599
|
4
|
+
data.tar.gz: c06dcf22be9ebb55652d5657cefa673e02c1a1175a212c4e79fd875f50b4927e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '04678b5942585f163ab151b15900f796d263b1d99c288377ba5d8310116815dbda0042aa2f0dc93c37428e08bd9f5853408e8a735cda7ef40cd86d89f6f8ece5'
|
7
|
+
data.tar.gz: b87900c9b522933fac16ea7cb59be00b73161749b5d313648b627d5fa3f14488705f1f836fdeba452ea7b8cb6b4bf30d71a40b3f109b9d8071d14ee1c1c15e44
|
@@ -10,12 +10,14 @@ module RelatonNist
|
|
10
10
|
"hasTranslation" => "hasTranslation",
|
11
11
|
"isTranslationOf" => "translatedFrom",
|
12
12
|
"hasPreprint" => "hasReprint",
|
13
|
-
"isPreprintOf" => "
|
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
|
111
|
-
ns
|
112
|
-
|
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
|
data/lib/relaton_nist/version.rb
CHANGED
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
|
+
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-09-
|
11
|
+
date: 2023-09-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: relaton-bib
|