relaton-calconnect 1.9.2 → 1.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +2 -0
- data/README.adoc +20 -0
- data/grammars/basicdoc.rng +26 -7
- data/grammars/biblio.rng +31 -6
- data/grammars/isodoc.rng +687 -89
- data/grammars/reqt.rng +34 -5
- data/lib/relaton_calconnect/scrapper.rb +9 -13
- data/lib/relaton_calconnect/version.rb +1 -1
- data/relaton_calconnect.gemspec +1 -1
- metadata +4 -4
data/grammars/reqt.rng
CHANGED
@@ -58,15 +58,23 @@
|
|
58
58
|
<optional>
|
59
59
|
<attribute name="type"/>
|
60
60
|
</optional>
|
61
|
+
<optional>
|
62
|
+
<attribute name="tag"/>
|
63
|
+
</optional>
|
64
|
+
<optional>
|
65
|
+
<attribute name="multilingual-rendering">
|
66
|
+
<ref name="MultilingualRenderingType"/>
|
67
|
+
</attribute>
|
68
|
+
</optional>
|
61
69
|
<optional>
|
62
70
|
<ref name="reqtitle"/>
|
63
71
|
</optional>
|
64
72
|
<optional>
|
65
73
|
<ref name="label"/>
|
66
74
|
</optional>
|
67
|
-
<
|
75
|
+
<zeroOrMore>
|
68
76
|
<ref name="subject"/>
|
69
|
-
</
|
77
|
+
</zeroOrMore>
|
70
78
|
<zeroOrMore>
|
71
79
|
<ref name="reqinherit"/>
|
72
80
|
</zeroOrMore>
|
@@ -80,6 +88,7 @@
|
|
80
88
|
<ref name="verification"/>
|
81
89
|
<ref name="import"/>
|
82
90
|
<ref name="description"/>
|
91
|
+
<ref name="component"/>
|
83
92
|
</choice>
|
84
93
|
</zeroOrMore>
|
85
94
|
<optional>
|
@@ -100,17 +109,23 @@
|
|
100
109
|
</define>
|
101
110
|
<define name="label">
|
102
111
|
<element name="label">
|
103
|
-
<
|
112
|
+
<oneOrMore>
|
113
|
+
<ref name="TextElement"/>
|
114
|
+
</oneOrMore>
|
104
115
|
</element>
|
105
116
|
</define>
|
106
117
|
<define name="subject">
|
107
118
|
<element name="subject">
|
108
|
-
<
|
119
|
+
<oneOrMore>
|
120
|
+
<ref name="TextElement"/>
|
121
|
+
</oneOrMore>
|
109
122
|
</element>
|
110
123
|
</define>
|
111
124
|
<define name="reqinherit">
|
112
125
|
<element name="inherit">
|
113
|
-
<
|
126
|
+
<oneOrMore>
|
127
|
+
<ref name="TextElement"/>
|
128
|
+
</oneOrMore>
|
114
129
|
</element>
|
115
130
|
</define>
|
116
131
|
<define name="measurementtarget">
|
@@ -138,6 +153,12 @@
|
|
138
153
|
<ref name="RequirementSubpart"/>
|
139
154
|
</element>
|
140
155
|
</define>
|
156
|
+
<define name="component">
|
157
|
+
<element name="component">
|
158
|
+
<attribute name="class"/>
|
159
|
+
<ref name="RequirementSubpart"/>
|
160
|
+
</element>
|
161
|
+
</define>
|
141
162
|
<define name="reqt_references">
|
142
163
|
<element name="references">
|
143
164
|
<oneOrMore>
|
@@ -164,6 +185,14 @@
|
|
164
185
|
<data type="boolean"/>
|
165
186
|
</attribute>
|
166
187
|
</optional>
|
188
|
+
<optional>
|
189
|
+
<attribute name="tag"/>
|
190
|
+
</optional>
|
191
|
+
<optional>
|
192
|
+
<attribute name="multilingual-rendering">
|
193
|
+
<ref name="MultilingualRenderingType"/>
|
194
|
+
</attribute>
|
195
|
+
</optional>
|
167
196
|
<oneOrMore>
|
168
197
|
<ref name="BasicBlock"/>
|
169
198
|
</oneOrMore>
|
@@ -7,7 +7,7 @@ module RelatonCalconnect
|
|
7
7
|
class << self
|
8
8
|
# papam hit [Hash]
|
9
9
|
# @return [RelatonOgc::OrcBibliographicItem]
|
10
|
-
def parse_page(hit)
|
10
|
+
def parse_page(hit) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
|
11
11
|
links = array(hit["link"])
|
12
12
|
link = links.detect { |l| l["type"] == "rxl" }
|
13
13
|
if link
|
@@ -15,9 +15,11 @@ module RelatonCalconnect
|
|
15
15
|
update_links bib, links
|
16
16
|
# XMLParser.from_xml bib_xml
|
17
17
|
else
|
18
|
-
bib = RelatonCalconnect::CcBibliographicItem.from_hash doc_to_hash
|
18
|
+
bib = RelatonCalconnect::CcBibliographicItem.from_hash doc_to_hash hit
|
19
|
+
end
|
20
|
+
bib.link.each do |l|
|
21
|
+
l.content.merge!(scheme: SCHEME, host: HOST) unless l.content.host
|
19
22
|
end
|
20
|
-
bib.link.each { |l| l.content.merge!(scheme: SCHEME, host: HOST) unless l.content.host }
|
21
23
|
bib
|
22
24
|
end
|
23
25
|
|
@@ -25,16 +27,7 @@ module RelatonCalconnect
|
|
25
27
|
|
26
28
|
# @param url [String]
|
27
29
|
# @return [String] XML
|
28
|
-
def fetch_bib_xml(url)
|
29
|
-
# rxl = get_rxl url
|
30
|
-
# uri_rxl = rxl.at("uri[@type='rxl']")
|
31
|
-
# return rxl.to_xml unless uri_rxl
|
32
|
-
|
33
|
-
# uri_xml = rxl.xpath("//uri").to_xml
|
34
|
-
# rxl = get_rxl uri_rxl.text
|
35
|
-
# docid = rxl.at "//docidentifier"
|
36
|
-
# docid.add_previous_sibling uri_xml
|
37
|
-
# rxl.to_xml
|
30
|
+
def fetch_bib_xml(url) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
|
38
31
|
rxl = get_rxl url
|
39
32
|
uri_rxl = rxl.at("uri[@type='rxl']")
|
40
33
|
if uri_rxl
|
@@ -44,6 +37,7 @@ module RelatonCalconnect
|
|
44
37
|
docid.add_previous_sibling uri_xml
|
45
38
|
end
|
46
39
|
xml = rxl.to_xml.gsub!(%r{(</?)technical-committee(>)}, '\1committee\2')
|
40
|
+
.gsub(%r{type="(?:csd|CC)"(?=>)}i, '\0 primary="true"')
|
47
41
|
RelatonCalconnect::XMLParser.from_xml xml
|
48
42
|
end
|
49
43
|
|
@@ -66,6 +60,8 @@ module RelatonCalconnect
|
|
66
60
|
tc = eg.delete("technical_committee")
|
67
61
|
eg.merge!(tc) if tc
|
68
62
|
end
|
63
|
+
dtps = %w[CC CSD]
|
64
|
+
array(doc["docid"]).detect { |id| dtps.include? id["type"].upcase }["primary"] = true
|
69
65
|
doc
|
70
66
|
end
|
71
67
|
|
data/relaton_calconnect.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton-calconnect
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
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:
|
11
|
+
date: 2022-04-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: equivalent-xml
|
@@ -128,14 +128,14 @@ dependencies:
|
|
128
128
|
requirements:
|
129
129
|
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: 1.
|
131
|
+
version: 1.11.0
|
132
132
|
type: :runtime
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: 1.
|
138
|
+
version: 1.11.0
|
139
139
|
description: 'RelatonIso: retrieve CC Standards for bibliographic use using the IsoBibliographicItem
|
140
140
|
model'
|
141
141
|
email:
|