relaton-ieee 1.10.0 → 1.11.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: 1b9712be210c320461271c9271cea901d24b5c5988beea4708ac074e42c02814
4
- data.tar.gz: b4438ca4aa0097d8fafe1e87884ddda1fd44b92eb3ad3661064f7078974d414f
3
+ metadata.gz: 26b97a44379b5aec10066301f3fb0c41c2fead4117a42d1142a24d6c6b524854
4
+ data.tar.gz: e35e4ddf09d1f8d70c12a191fd9435166dc33fd31bfb446816befed9ee617574
5
5
  SHA512:
6
- metadata.gz: fc3595268bd4b0f45c10041e2ff17feb2e1bd56b327f527f9602aef84a8082141433ed0b1048cb7cf104250da9dcc734ce04250437ea6b0104e3e862f64c4d67
7
- data.tar.gz: f110efe4119d5721df536ef066c146dae9bc75ca6205af2171cdd310e8d5c9a336960fcde6f71e4391ca2ba300c2c53c403716d563c4848d6ae9c258152b250c
6
+ metadata.gz: 88017c27ee3d56b1bee97059f6524c9c3264fe6f0fc79208da003ad13ad57ee386bc7e15812a5a56615ea209d6cc144af6abc0142fb76aae03c9eff22e6cafa6
7
+ data.tar.gz: 2855561c0a523670ab89da09599144c287cdaea316030f565fa25d89fe65278d41642385322e5aad7573c1d64ec86ef7ae104c494f49126dd14a0a4427e098f3
data/grammars/biblio.rng CHANGED
@@ -209,9 +209,6 @@
209
209
  <zeroOrMore>
210
210
  <ref name="contact"/>
211
211
  </zeroOrMore>
212
- <zeroOrMore>
213
- <ref name="uri"/>
214
- </zeroOrMore>
215
212
  </element>
216
213
  </define>
217
214
  <define name="fullname">
@@ -680,6 +677,9 @@
680
677
  <zeroOrMore>
681
678
  <ref name="extent"/>
682
679
  </zeroOrMore>
680
+ <optional>
681
+ <ref name="bibliographic_size"/>
682
+ </optional>
683
683
  <zeroOrMore>
684
684
  <ref name="accesslocation"/>
685
685
  </zeroOrMore>
@@ -828,6 +828,11 @@
828
828
  <optional>
829
829
  <attribute name="scope"/>
830
830
  </optional>
831
+ <optional>
832
+ <attribute name="primary">
833
+ <data type="boolean"/>
834
+ </attribute>
835
+ </optional>
831
836
  <text/>
832
837
  </element>
833
838
  </define>
@@ -920,9 +925,29 @@
920
925
  <text/>
921
926
  </element>
922
927
  </define>
928
+ <define name="sizevalue">
929
+ <element name="value">
930
+ <attribute name="type"/>
931
+ <text/>
932
+ </element>
933
+ </define>
934
+ <define name="bibliographic_size">
935
+ <element name="size">
936
+ <oneOrMore>
937
+ <ref name="sizevalue"/>
938
+ </oneOrMore>
939
+ </element>
940
+ </define>
923
941
  <define name="extent">
924
942
  <element name="extent">
925
- <ref name="BibItemLocality"/>
943
+ <choice>
944
+ <zeroOrMore>
945
+ <ref name="locality"/>
946
+ </zeroOrMore>
947
+ <zeroOrMore>
948
+ <ref name="localityStack"/>
949
+ </zeroOrMore>
950
+ </choice>
926
951
  </element>
927
952
  </define>
928
953
  <define name="series">
data/grammars/isodoc.rng CHANGED
@@ -152,9 +152,7 @@
152
152
  <data type="boolean"/>
153
153
  </attribute>
154
154
  </optional>
155
- <oneOrMore>
156
- <ref name="PureTextElement"/>
157
- </oneOrMore>
155
+ <ref name="XrefBody"/>
158
156
  </element>
159
157
  </define>
160
158
  <define name="erefType">
@@ -188,6 +186,42 @@
188
186
  <ref name="PureTextElement"/>
189
187
  </oneOrMore>
190
188
  </define>
189
+ <define name="localityStack">
190
+ <element name="localityStack">
191
+ <optional>
192
+ <attribute name="connective">
193
+ <choice>
194
+ <value>and</value>
195
+ <value>or</value>
196
+ <value>from</value>
197
+ <value>to</value>
198
+ <value/>
199
+ </choice>
200
+ </attribute>
201
+ </optional>
202
+ <zeroOrMore>
203
+ <ref name="locality"/>
204
+ </zeroOrMore>
205
+ </element>
206
+ </define>
207
+ <define name="sourceLocalityStack">
208
+ <element name="sourceLocalityStack">
209
+ <optional>
210
+ <attribute name="connective">
211
+ <choice>
212
+ <value>and</value>
213
+ <value>or</value>
214
+ <value>from</value>
215
+ <value>to</value>
216
+ <value/>
217
+ </choice>
218
+ </attribute>
219
+ </optional>
220
+ <zeroOrMore>
221
+ <ref name="sourceLocality"/>
222
+ </zeroOrMore>
223
+ </element>
224
+ </define>
191
225
  <define name="ul">
192
226
  <element name="ul">
193
227
  <attribute name="id">
@@ -1098,6 +1132,16 @@
1098
1132
  </define>
1099
1133
  </include>
1100
1134
  <!-- end overrides -->
1135
+ <define name="image" combine="choice">
1136
+ <element name="svg">
1137
+ <oneOrMore>
1138
+ <choice>
1139
+ <text/>
1140
+ <ref name="AnyElement"/>
1141
+ </choice>
1142
+ </oneOrMore>
1143
+ </element>
1144
+ </define>
1101
1145
  <define name="MultilingualRenderingType">
1102
1146
  <choice>
1103
1147
  <value>common</value>
@@ -2631,4 +2675,30 @@
2631
2675
  </zeroOrMore>
2632
2676
  </element>
2633
2677
  </define>
2678
+ <define name="XrefBody">
2679
+ <zeroOrMore>
2680
+ <ref name="XrefTarget"/>
2681
+ </zeroOrMore>
2682
+ <oneOrMore>
2683
+ <ref name="PureTextElement"/>
2684
+ </oneOrMore>
2685
+ </define>
2686
+ <define name="XrefTarget">
2687
+ <element name="location">
2688
+ <attribute name="target">
2689
+ <data type="string">
2690
+ <param name="pattern">\i\c*|\c+#\c+</param>
2691
+ </data>
2692
+ </attribute>
2693
+ <attribute name="connective">
2694
+ <choice>
2695
+ <value>and</value>
2696
+ <value>or</value>
2697
+ <value>from</value>
2698
+ <value>to</value>
2699
+ <value/>
2700
+ </choice>
2701
+ </attribute>
2702
+ </element>
2703
+ </define>
2634
2704
  </grammar>
@@ -114,7 +114,7 @@ module RelatonIeee
114
114
  # @return [Array<RelatonBib::DocumentIdentifier>]
115
115
  #
116
116
  def parse_docid
117
- ids = [{ id: pubid.to_s, type: "IEEE" }]
117
+ ids = [{ id: pubid.to_s, type: "IEEE", primary: true }]
118
118
  isbn = doc.at("./publicationinfo/isbn")
119
119
  ids << { id: isbn.text, type: "ISBN" } if isbn
120
120
  doi = doc.at("./volume/article/articleinfo/articledoi")
@@ -21,10 +21,7 @@ module RelatonIeee
21
21
  resp = Faraday.post url, { action: "ieee_cloudsearch", q: query }
22
22
  json = JSON.parse resp.body
23
23
  html = Nokogiri::HTML json["html"]
24
- # @array = json["results"]["hits"]["hit"].reduce([]) do |s, hit|
25
24
  @array = html.xpath("//h4/a").reduce([]) do |s, hit|
26
- # fields = hit["fields"]
27
- # ref = html.at("//h4/a[@href='#{fields['doc_id_l']}']").text.strip
28
25
  ref = hit.text.strip
29
26
  /^(?:\w+\s)?(?<code2>[A-Z\d.]+)(?:-(?<year>\d{4}))?/ =~ ref
30
27
  next s unless code2 && code1 =~ %r{^#{code2}}
@@ -19,6 +19,7 @@ module RelatonIeee
19
19
  script: ["Latn"],
20
20
  date: fetch_date(doc),
21
21
  committee: fetch_committee(doc),
22
+ place: ["Piscataway, NJ, USA"],
22
23
  )
23
24
  end
24
25
  # rubocop:enable Metrics/MethodLength, Metrics/AbcSize
@@ -38,7 +39,7 @@ module RelatonIeee
38
39
  # @param ref [String]
39
40
  # @return [Array<RelatonBib::DocumentIdentifier>]
40
41
  def fetch_docid(ref)
41
- [RelatonBib::DocumentIdentifier.new(id: ref, type: "IEEE")]
42
+ [RelatonBib::DocumentIdentifier.new(id: ref, type: "IEEE", primary: true)]
42
43
  end
43
44
 
44
45
  # @param url [String]
@@ -75,10 +76,19 @@ module RelatonIeee
75
76
 
76
77
  # @param doc [Nokogiri::HTML::Document]
77
78
  # @return [Array<RelatonBib::ContributionInfo>]
78
- def fetch_contributor(doc)
79
+ def fetch_contributor(doc) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
80
+ address = RelatonBib::Address.new(
81
+ street: ["445 Hoes Lane"], postcode: "08854-4141", city: "Piscataway",
82
+ state: "NJ", country: "USA"
83
+ )
84
+ org = RelatonBib::Organization.new(
85
+ name: "Institute of Electrical and Electronics Engineers",
86
+ abbreviation: "IEEE", contact: [address]
87
+ )
88
+ contrib = RelatonBib::ContributionInfo.new(entity: org, role: [type: "publisher"])
79
89
  doc.xpath("//dd[@id='stnd-staff-liaison']/text()").map do |name|
80
90
  person_contrib(name.text.strip)
81
- end
91
+ end << contrib
82
92
  end
83
93
 
84
94
  # @param name [String]
@@ -1,3 +1,3 @@
1
1
  module RelatonIeee
2
- VERSION = "1.10.0".freeze
2
+ VERSION = "1.11.0".freeze
3
3
  end
data/relaton_ieee.gemspec CHANGED
@@ -38,6 +38,6 @@ Gem::Specification.new do |spec|
38
38
  spec.add_development_dependency "webmock"
39
39
 
40
40
  spec.add_dependency "faraday", "~> 1.1"
41
- spec.add_dependency "relaton-bib", "~> 1.10.0"
41
+ spec.add_dependency "relaton-bib", "~> 1.11.0"
42
42
  spec.add_dependency "rubyzip", "~> 2.3.0"
43
43
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-ieee
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.0
4
+ version: 1.11.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: 2022-01-30 00:00:00.000000000 Z
11
+ date: 2022-04-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: equivalent-xml
@@ -100,14 +100,14 @@ dependencies:
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: 1.10.0
103
+ version: 1.11.0
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: 1.10.0
110
+ version: 1.11.0
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: rubyzip
113
113
  requirement: !ruby/object:Gem::Requirement