relaton-w3c 1.9.3 → 1.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +2 -0
  3. data/README.adoc +2 -2
  4. data/data/reference.W3C.CR-rdf-schema.xml +16 -0
  5. data/data/reference.W3C.DSig-label.xml +32 -0
  6. data/data/reference.W3C.P3P-rdfschema.xml +26 -0
  7. data/data/reference.W3C.P3P.xml +38 -0
  8. data/data/reference.W3C.PICS-labels.xml +43 -0
  9. data/data/reference.W3C.PICS-rules.xml +38 -0
  10. data/data/reference.W3C.PICS-services.xml +37 -0
  11. data/data/reference.W3C.REC-RUBY.xml +22 -0
  12. data/data/reference.W3C.REC-XHTML.xml +12 -0
  13. data/data/reference.W3C.REC-rdf-syntax.xml +31 -0
  14. data/data/reference.W3C.REC-xml-1998.xml +20 -0
  15. data/data/reference.W3C.REC-xml-names.xml +28 -0
  16. data/data/reference.W3C.REC-xml.xml +35 -0
  17. data/data/reference.W3C.REC-xmlenc-core.xml +23 -0
  18. data/data/reference.W3C.REC-xmlschema-1.xml +23 -0
  19. data/data/reference.W3C.REC-xmlschema-2.xml +17 -0
  20. data/data/reference.W3C.daml-oil-reference.xml +39 -0
  21. data/data/reference.W3C.soap11.xml +56 -0
  22. data/data/reference.W3C.soap12-part1.xml +38 -0
  23. data/data/reference.W3C.soap12-part2.xml +38 -0
  24. data/data/reference.W3C.xkms.xml +50 -0
  25. data/data/reference.W3C.xml-c14n.xml +15 -0
  26. data/data/reference.W3C.xmldsig-core.xml +26 -0
  27. data/data/reference.W3C.xmlenc-core.xml +20 -0
  28. data/data/reference.W3C.xpath.xml +22 -0
  29. data/grammars/basicdoc.rng +26 -7
  30. data/grammars/biblio.rng +2 -2
  31. data/grammars/isodoc.rng +617 -89
  32. data/grammars/reqt.rng +34 -5
  33. data/lib/relaton_w3c/bibxml_parser.rb +17 -0
  34. data/lib/relaton_w3c/data_fethcer.rb +4 -0
  35. data/lib/relaton_w3c/version.rb +1 -1
  36. data/lib/relaton_w3c/w3c_bibliography.rb +6 -1
  37. data/lib/relaton_w3c.rb +1 -0
  38. data/relaton_w3c.gemspec +1 -1
  39. metadata +32 -6
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
- <optional>
75
+ <zeroOrMore>
68
76
  <ref name="subject"/>
69
- </optional>
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
- <text/>
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
- <text/>
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
- <text/>
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>
@@ -0,0 +1,17 @@
1
+ module RelatonW3c
2
+ module BibXMLParser
3
+ extend RelatonBib::BibXMLParser
4
+ extend BibXMLParser
5
+
6
+ #
7
+ # Return PubID type
8
+ #
9
+ # @param [String] _ docidentifier
10
+ #
11
+ # @return [String] type
12
+ #
13
+ def pubid_type(_)
14
+ "W3C"
15
+ end
16
+ end
17
+ end
@@ -47,6 +47,10 @@ module RelatonW3c
47
47
  #
48
48
  def fetch
49
49
  query.each { |sl| save_doc DataParser.parse(sl, self) }
50
+ Dir[File.expand_path("../../data/*", __dir__)].each do |file|
51
+ xml = File.read file, encoding: "UTF-8"
52
+ save_doc BibXMLParser.parse(xml)
53
+ end
50
54
  end
51
55
 
52
56
  #
@@ -1,3 +1,3 @@
1
1
  module RelatonW3c
2
- VERSION = "1.9.3".freeze
2
+ VERSION = "1.10.0".freeze
3
3
  end
@@ -15,6 +15,8 @@ module RelatonW3c
15
15
  file = text.sub(/^W3C\s/, "").gsub(/[\s,:\/]/, "_").squeeze("_").upcase
16
16
  url = "#{SOURCE}#{file}.yaml"
17
17
  resp = Net::HTTP.get_response(URI.parse(url))
18
+ return unless resp.code == "200"
19
+
18
20
  hash = YAML.safe_load resp.body
19
21
  item_hash = ::RelatonW3c::HashConverter.hash_to_bib(hash)
20
22
  ::RelatonW3c::W3cBibliographicItem.new(**item_hash)
@@ -32,7 +34,10 @@ module RelatonW3c
32
34
  def get(ref, _year = nil, _opts = {})
33
35
  warn "[relaton-w3c] (\"#{ref}\") fetching..."
34
36
  result = search(ref)
35
- return unless result # .any?
37
+ unless result
38
+ warn "[relaton-w3c] (\"#{ref}\") not found."
39
+ return
40
+ end
36
41
 
37
42
  # ret = result.first.fetch
38
43
  warn "[relaton-w3c] (\"#{ref}\") found #{result.title.first.title.content}"
data/lib/relaton_w3c.rb CHANGED
@@ -6,6 +6,7 @@ require "relaton_w3c/hit_collection"
6
6
  require "relaton_w3c/hit"
7
7
  require "relaton_w3c/scrapper"
8
8
  require "relaton_w3c/xml_parser"
9
+ require "relaton_w3c/bibxml_parser"
9
10
  require "relaton_w3c/hash_converter"
10
11
  require "relaton_w3c/data_fethcer"
11
12
 
data/relaton_w3c.gemspec CHANGED
@@ -40,6 +40,6 @@ Gem::Specification.new do |spec|
40
40
  spec.add_dependency "linkeddata", "~> 3.1.0"
41
41
  spec.add_dependency "mechanize", "~> 2.8.0"
42
42
  spec.add_dependency "rdf", "~> 3.1.0"
43
- spec.add_dependency "relaton-bib", ">= 1.9.0"
43
+ spec.add_dependency "relaton-bib", "~> 1.10.0"
44
44
  spec.add_dependency "sparql", "~> 3.1.0"
45
45
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-w3c
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.3
4
+ version: 1.10.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: 2021-11-20 00:00:00.000000000 Z
11
+ date: 2022-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: equivalent-xml
@@ -126,16 +126,16 @@ dependencies:
126
126
  name: relaton-bib
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - ">="
129
+ - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: 1.9.0
131
+ version: 1.10.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.9.0
138
+ version: 1.10.0
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: sparql
141
141
  requirement: !ruby/object:Gem::Requirement
@@ -170,11 +170,37 @@ files:
170
170
  - bin/console
171
171
  - bin/rspec
172
172
  - bin/setup
173
+ - data/reference.W3C.CR-rdf-schema.xml
174
+ - data/reference.W3C.DSig-label.xml
175
+ - data/reference.W3C.P3P-rdfschema.xml
176
+ - data/reference.W3C.P3P.xml
177
+ - data/reference.W3C.PICS-labels.xml
178
+ - data/reference.W3C.PICS-rules.xml
179
+ - data/reference.W3C.PICS-services.xml
180
+ - data/reference.W3C.REC-RUBY.xml
181
+ - data/reference.W3C.REC-XHTML.xml
182
+ - data/reference.W3C.REC-rdf-syntax.xml
183
+ - data/reference.W3C.REC-xml-1998.xml
184
+ - data/reference.W3C.REC-xml-names.xml
185
+ - data/reference.W3C.REC-xml.xml
186
+ - data/reference.W3C.REC-xmlenc-core.xml
187
+ - data/reference.W3C.REC-xmlschema-1.xml
188
+ - data/reference.W3C.REC-xmlschema-2.xml
189
+ - data/reference.W3C.daml-oil-reference.xml
190
+ - data/reference.W3C.soap11.xml
191
+ - data/reference.W3C.soap12-part1.xml
192
+ - data/reference.W3C.soap12-part2.xml
193
+ - data/reference.W3C.xkms.xml
194
+ - data/reference.W3C.xml-c14n.xml
195
+ - data/reference.W3C.xmldsig-core.xml
196
+ - data/reference.W3C.xmlenc-core.xml
197
+ - data/reference.W3C.xpath.xml
173
198
  - grammars/basicdoc.rng
174
199
  - grammars/biblio.rng
175
200
  - grammars/isodoc.rng
176
201
  - grammars/reqt.rng
177
202
  - lib/relaton_w3c.rb
203
+ - lib/relaton_w3c/bibxml_parser.rb
178
204
  - lib/relaton_w3c/data_fethcer.rb
179
205
  - lib/relaton_w3c/data_parser.rb
180
206
  - lib/relaton_w3c/hash_converter.rb