relaton-w3c 1.9.0 → 1.9.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: 58a4044db1d46717f23268b36efff858fbfdccd7e8c3f2b47d98246831512d42
4
- data.tar.gz: bf87dbf1f5da70e68dc771f115363c531188b103a23bbf05872c68a8c47131a4
3
+ metadata.gz: ea91306625ad2f0f53980c20651589cd04de493874cbc209a91bafaec46fa9a2
4
+ data.tar.gz: '04608d998f36b0fc01cfd2a284e422bdc24120e91ea2d8f2e1e4a3dea44189dc'
5
5
  SHA512:
6
- metadata.gz: 6b2fae6c6cf119defdf15284f68eac82ccf50766a162889a2f09ca4c3f9e7ffa1705b9f71a2b4b0da20939948f59e424f5a18489bb5ec19d18cfdf742f150aa7
7
- data.tar.gz: c3ecafb387e50c47a93eeb3fde746420ee801667afe24a2277d0b4812d42a922a67e5374c919d1dff091bd0f02669f156609b0dcb383390f44d9fe6d245023d1
6
+ metadata.gz: 03ce95e1ed894df67208a6be15d61f36a8ba186553bf99f458244b07ba68eebe7c4d5a9ed7ff0d4739f05452f8a6ccd541c0462a760cd99bf9ce53bb61360220
7
+ data.tar.gz: edb1f2b02e369e0056291e7c55a2d0115cd2f09e8ad1896e027a4fbe9928494b304099bb0cd9ae4dd9a71a11395b0b98d6f1235e2346ba86a06f59d5aa0b50ec
data/Gemfile CHANGED
@@ -3,5 +3,5 @@ source "https://rubygems.org"
3
3
  # Specify your gem's dependencies in relaton_w3c.gemspec
4
4
  gemspec
5
5
 
6
- gem "rake", "~> 12.0"
6
+ gem "rake", "~> 13.0"
7
7
  gem "rspec", "~> 3.0"
data/README.adoc CHANGED
@@ -115,6 +115,16 @@ RelatonW3c::W3cBibliography.get "W3C WD JSON-LD 1.1 2019-10-18"
115
115
  ...
116
116
  ----
117
117
 
118
+ === Typed links
119
+
120
+ Each W3C document has `src` type link.
121
+
122
+ [source,ruby]
123
+ ----
124
+ item.link
125
+ => [#<RelatonBib::TypedUri:0x00007fc533ed4040 @content=#<Addressable::URI:0xcc22c URI:https://www.w3.org/TR/2020/REC-json-ld11-20200716/>, @type="src">]
126
+ ----
127
+
118
128
  === Create bibliographic item from XML
119
129
  [source,ruby]
120
130
  ----
@@ -141,6 +151,25 @@ RelatonW3c::W3cBibliographicItem.new bib_hash
141
151
  ...
142
152
  ----
143
153
 
154
+ === Fetch data
155
+
156
+ There is a W3C dataset http://www.w3.org/2002/01/tr-automation/tr.rdf which can be converted into RelatonXML/BibXML/BibYAML formats.
157
+
158
+ The method `RelatonW3c::DataFetcher.fetch(output: "data", format: "yaml")` converts all the documents from the dataset and save them to the `./data` folder in YAML format.
159
+ Arguments:
160
+
161
+ - `output` - folder to save documents (default './data').
162
+ - `format` - format in which the documents are saved. Possimle formats are: `yaml`, `xml`, `bibxml` (default `yaml`).
163
+
164
+ [source,ruby]
165
+ ----
166
+ RelatonW3c::DataFetcher.fetch
167
+ Started at: 2021-11-19 13:32:05 +0100
168
+ Stopped at: 2021-11-19 13:34:40 +0100
169
+ Done in: 155 sec.
170
+ => nil
171
+ ----
172
+
144
173
  == Development
145
174
 
146
175
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -0,0 +1,106 @@
1
+ require "rdf"
2
+ require "linkeddata"
3
+ require "sparql"
4
+ require "mechanize"
5
+ require "relaton_w3c/data_parser"
6
+
7
+ module RelatonW3c
8
+ class DataFetcher
9
+ USED_TYPES = %w[WD NOTE PER PR REC CR].freeze
10
+
11
+ attr_reader :data, :group_names
12
+
13
+ #
14
+ # Data fetcher initializer
15
+ #
16
+ # @param [String] output directory to save files
17
+ # @param [String] format format of output files (xml, yaml, bibxml)
18
+ #
19
+ def initialize(output, format)
20
+ @output = output
21
+ @format = format
22
+ @ext = format.sub(/^bib/, "")
23
+ dir = File.dirname(File.expand_path(__FILE__))
24
+ @group_names = YAML.load_file(File.join(dir , "workgroups.yaml"))
25
+ @data = RDF::Repository.load("http://www.w3.org/2002/01/tr-automation/tr.rdf")
26
+ @files = []
27
+ end
28
+
29
+ #
30
+ # Initialize fetcher and run fetch
31
+ #
32
+ # @param [Strin] output directory to save files, default: "data"
33
+ # @param [Strin] format format of output files (xml, yaml, bibxml), default: yaml
34
+ #
35
+ def self.fetch(output: "data", format: "yaml")
36
+ t1 = Time.now
37
+ puts "Started at: #{t1}"
38
+ FileUtils.mkdir_p output unless Dir.exist? output
39
+ new(output, format).fetch
40
+ t2 = Time.now
41
+ puts "Stopped at: #{t2}"
42
+ puts "Done in: #{(t2 - t1).round} sec."
43
+ end
44
+
45
+ #
46
+ # Parse documents
47
+ #
48
+ def fetch
49
+ query.each { |sl| save_doc DataParser.parse(sl, self) }
50
+ end
51
+
52
+ #
53
+ # Query RDF source for documents
54
+ #
55
+ # @return [RDF::Query::Solutions] query results
56
+ #
57
+ def query # rubocop:disable Metrics/MethodLength
58
+ sse = SPARQL.parse(%(
59
+ PREFIX : <http://www.w3.org/2001/02pd/rec54#>
60
+ PREFIX dc: <http://purl.org/dc/elements/1.1/>
61
+ PREFIX doc: <http://www.w3.org/2000/10/swap/pim/doc#>
62
+ # PREFIX mat: <http://www.w3.org/2002/05/matrix/vocab#>
63
+ PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
64
+ SELECT ?link ?title ?date
65
+ WHERE {
66
+ ?link dc:title ?title ; dc:date ?date . # ; doc:versionOf ?version_of .
67
+ }
68
+ ))
69
+ data.query sse
70
+ end
71
+
72
+ #
73
+ # Save document to file
74
+ #
75
+ # @param [RelatonW3c::W3cBibliographicItem, nil] bib bibliographic item
76
+ #
77
+ def save_doc(bib) # rubocop:disable Metrics/MethodLength
78
+ return unless bib
79
+
80
+ c = case @format
81
+ when "xml" then bib.to_xml(bibdata: true)
82
+ when "yaml" then bib.to_hash.to_yaml
83
+ else bib.send("to_#{@format}")
84
+ end
85
+ file = file_name(bib)
86
+ if @files.include? file
87
+ warn "File #{file} already exists. Document: #{bib.docnumber}"
88
+ else
89
+ @files << file
90
+ end
91
+ File.write file, c, encoding: "UTF-8"
92
+ end
93
+
94
+ #
95
+ # Generate file name
96
+ #
97
+ # @param [RelatonW3c::W3cBibliographicItem] bib bibliographic item
98
+ #
99
+ # @return [String] file name
100
+ #
101
+ def file_name(bib)
102
+ name = bib.docnumber.gsub(/[\s,:\/]/, "_").squeeze("_").upcase
103
+ File.join @output, "#{name}.#{@ext}"
104
+ end
105
+ end
106
+ end
@@ -0,0 +1,205 @@
1
+ module RelatonW3c
2
+ class DataParser
3
+ #
4
+ # Document parser initalization
5
+ #
6
+ # @param [RDF::Query::Solution] sol entry from the SPARQL query
7
+ # @param [RelatonW3c::DataFetcher] fetcher data fetcher
8
+ #
9
+ def initialize(sol, fetcher)
10
+ @sol = sol
11
+ @fetcher = fetcher
12
+ end
13
+
14
+ #
15
+ # Initialize document parser and run it
16
+ #
17
+ # @param [RDF::Query::Solution] sol entry from the SPARQL query
18
+ # @param [RelatonW3c::DataFetcher] fetcher data fetcher
19
+ #
20
+ # @return [RelatonW3c:W3cBibliographicItem, nil] bibliographic item
21
+ #
22
+ def self.parse(sol, fetcher)
23
+ new(sol, fetcher).parse
24
+ end
25
+
26
+ #
27
+ # Parse document
28
+ #
29
+ # @return [RelatonW3c:W3cBibliographicItem, nil] bibliographic item
30
+ #
31
+ def parse # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
32
+ return unless @fetcher.class::USED_TYPES.include? type
33
+
34
+ RelatonW3c::W3cBibliographicItem.new(
35
+ type: "standard",
36
+ doctype: parse_doctype,
37
+ fetched: Date.today.to_s,
38
+ language: ["en"],
39
+ script: ["Latn"],
40
+ title: parse_title,
41
+ link: parse_link,
42
+ docid: parse_docid,
43
+ docnumber: identifier(@sol.link.to_s),
44
+ series: parse_series,
45
+ date: parse_date,
46
+ relation: parse_relation,
47
+ contributor: parse_contrib,
48
+ editorialgroup: parse_editorialgroup,
49
+ )
50
+ end
51
+
52
+ #
53
+ # Parse title
54
+ #
55
+ # @return [RelatonBib::TypedTitleStringCollection] title
56
+ #
57
+ def parse_title
58
+ t = RelatonBib::TypedTitleString.new title: @sol.title.to_s
59
+ RelatonBib::TypedTitleStringCollection.new [t]
60
+ end
61
+
62
+ #
63
+ # Parse link
64
+ #
65
+ # @return [Array<RelatonBib::TypedUri>] link
66
+ #
67
+ def parse_link
68
+ [RelatonBib::TypedUri.new(type: "src", content: @sol.link.to_s)]
69
+ end
70
+
71
+ #
72
+ # Parse docidentifier
73
+ #
74
+ # @return [Arra<RelatonBib::DocumentIdentifier>] docidentifier
75
+ #
76
+ def parse_docid
77
+ id = pub_id(@sol.link.to_s)
78
+ [RelatonBib::DocumentIdentifier.new(type: "W3C", id: id)]
79
+ end
80
+
81
+ #
82
+ # Generate PubID
83
+ #
84
+ # @param [String] url url
85
+ #
86
+ # @return [String] PubID
87
+ #
88
+ def pub_id(url)
89
+ "W3C #{identifier(url)}"
90
+ end
91
+
92
+ def identifier(url)
93
+ /.+\/(\w+(?:-[\w.]+)+(?:\/\w+)?)/.match(url)[1].to_s
94
+ end
95
+
96
+ #
97
+ # Parse series
98
+ #
99
+ # @return [Array<RelatonBib::Series>] series
100
+ #
101
+ def parse_series
102
+ title = RelatonBib::TypedTitleString.new content: "W3C #{type}"
103
+ [RelatonBib::Series.new(title: title, number: identifier(@sol.link.to_s))]
104
+ end
105
+
106
+ def type # rubocop:disable Metrics/MethodLength
107
+ @type ||= begin
108
+ sse = SPARQL.parse(%(
109
+ PREFIX : <http://www.w3.org/2001/02pd/rec54#>
110
+ PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
111
+ SELECT ?type
112
+ WHERE {
113
+ { <#{@sol.link}> rdf:type ?type }
114
+ }
115
+ ))
116
+ tps = @fetcher.data.query(sse).map { |s| s.type.to_s.split("#").last }
117
+ tps.detect { |t| Scrapper::DOCTYPES.key?(t) }
118
+ end
119
+ end
120
+
121
+ #
122
+ # Parse doctype
123
+ #
124
+ # @return [Strinf] doctype
125
+ #
126
+ def parse_doctype
127
+ Scrapper::DOCTYPES[type]
128
+ end
129
+
130
+ def parse_date
131
+ [RelatonBib::BibliographicDate.new(type: "published", on: @sol.date.to_s)]
132
+ end
133
+
134
+ #
135
+ # Parse relation
136
+ #
137
+ # @return [Array<RelatonBib::DocumentRelation>] relation
138
+ #
139
+ def parse_relation # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
140
+ sse = SPARQL.parse(%(
141
+ PREFIX doc: <http://www.w3.org/2000/10/swap/pim/doc#>
142
+ SELECT ?obsoletes
143
+ WHERE {
144
+ VALUES ?p { doc:obsoletes }
145
+ { <#{@sol.link}> ?p ?obsoletes }
146
+ }
147
+ ))
148
+ @fetcher.data.query(sse).order_by(:obsoletes).map do |r|
149
+ tp, url = r.to_h.first
150
+ fr = RelatonBib::LocalizedString.new pub_id(url.to_s)
151
+ bib = W3cBibliographicItem.new formattedref: fr
152
+ RelatonBib::DocumentRelation.new(type: tp.to_s, bibitem: bib)
153
+ end
154
+ end
155
+
156
+ #
157
+ # Parse contributor
158
+ #
159
+ # @return [Array<RelatonBib::ContributionInfo>] contributor
160
+ #
161
+ def parse_contrib # rubocop:disable Metrics/MethodLength
162
+ sse = SPARQL.parse(%(
163
+ PREFIX : <http://www.w3.org/2001/02pd/rec54#>
164
+ PREFIX contact: <http://www.w3.org/2000/10/swap/pim/contact#>
165
+ SELECT ?full_name
166
+ WHERE {
167
+ <#{@sol.link}> :editor/contact:fullName ?full_name
168
+ }
169
+ ))
170
+ @fetcher.data.query(sse).order_by(:full_name).map do |ed|
171
+ cn = RelatonBib::LocalizedString.new(ed.full_name.to_s, "en", "Latn")
172
+ n = RelatonBib::FullName.new completename: cn
173
+ p = RelatonBib::Person.new name: n
174
+ RelatonBib::ContributionInfo.new entity: p, role: [type: "editor"]
175
+ end
176
+ end
177
+
178
+ #
179
+ # Parse editorialgroup
180
+ #
181
+ # @return [RelatonBib::EditorialGroup] editorialgroup
182
+ #
183
+ def parse_editorialgroup # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
184
+ sse = SPARQL.parse(%(
185
+ PREFIX org: <http://www.w3.org/2001/04/roadmap/org#>
186
+ PREFIX contact: <http://www.w3.org/2000/10/swap/pim/contact#>
187
+ SELECT ?home_page
188
+ WHERE {
189
+ <#{@sol.link}> org:deliveredBy/contact:homePage ?home_page
190
+ }
191
+ ))
192
+ res = @fetcher.data.query(sse).order_by(:home_page)
193
+ tc = res.each_with_object([]) do |edg, obj|
194
+ wg = @fetcher.group_names[edg.home_page.to_s.sub(/\/$/, "")]
195
+ if wg
196
+ rwg = RelatonBib::WorkGroup.new name: wg["name"]
197
+ obj << RelatonBib::TechnicalCommittee.new(rwg)
198
+ else
199
+ warn "Working group name not found for #{edg.home_page}"
200
+ end
201
+ end
202
+ RelatonBib::EditorialGroup.new tc
203
+ end
204
+ end
205
+ end
@@ -4,11 +4,12 @@ module RelatonW3c
4
4
  class Processor < Relaton::Processor
5
5
  attr_reader :idtype
6
6
 
7
- def initialize
7
+ def initialize # rubocop:disable Lint/MissingSuper
8
8
  @short = :relaton_w3c
9
9
  @prefix = "W3C"
10
10
  @defaultprefix = %r{^W3C\s}
11
11
  @idtype = "W3C"
12
+ @datasets = %w[w3c-rdf]
12
13
  end
13
14
 
14
15
  # @param code [String]
@@ -19,6 +20,18 @@ module RelatonW3c
19
20
  ::RelatonW3c::W3cBibliography.get(code, date, opts)
20
21
  end
21
22
 
23
+ #
24
+ # Fetch all the documents from http://www.w3.org/2002/01/tr-automation/tr.rdf
25
+ #
26
+ # @param [String] _source source name
27
+ # @param [Hash] opts
28
+ # @option opts [String] :output directory to output documents
29
+ # @option opts [String] :format
30
+ #
31
+ def fetch_data(_source, opts)
32
+ DataFetcher.fetch(**opts)
33
+ end
34
+
22
35
  # @param xml [String]
23
36
  # @return [RelatonCalconnect::CcBibliographicItem]
24
37
  def from_xml(xml)
@@ -1,16 +1,16 @@
1
1
  module RelatonW3c
2
2
  class Scrapper
3
- class << self
4
- DOCTYPES = {
5
- "CR" => "candidateRecommendation",
6
- "NOTE" => "groupNote",
7
- "PER" => "proposedEditedRecommendation",
8
- "PR" => "proposedRecommendation",
9
- "REC" => "recommendation",
10
- "RET" => "retired",
11
- "WD" => "workingDraft",
12
- }.freeze
3
+ DOCTYPES = {
4
+ "CR" => "candidateRecommendation",
5
+ "NOTE" => "groupNote",
6
+ "PER" => "proposedEditedRecommendation",
7
+ "PR" => "proposedRecommendation",
8
+ "REC" => "recommendation",
9
+ "RET" => "retired",
10
+ "WD" => "workingDraft",
11
+ }.freeze
13
12
 
13
+ class << self
14
14
  # @param hit [Hash]
15
15
  # @return [RelatonW3c::W3cBibliographicItem]
16
16
  def parse_page(hit) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
@@ -1,3 +1,3 @@
1
1
  module RelatonW3c
2
- VERSION = "1.9.0".freeze
2
+ VERSION = "1.9.1".freeze
3
3
  end
@@ -0,0 +1,339 @@
1
+ 'https://www.w3.org/DOM/Group':
2
+ name: Web Hypertext Application Technology Working Group
3
+ abbrev: WHATWG
4
+ 'https://www.w3.org/2002/mmi':
5
+ name: Multimodal Interaction Working Group
6
+ 'https://www.w3.org/Math':
7
+ name: Math Working Group
8
+ 'https://www.w3.org/html/wg':
9
+ name: HTML Working Group
10
+ abbrev: HTMLWG
11
+ 'https://www.w3.org/groups/wg/htmlwg':
12
+ name: HTML Working Group
13
+ abbrev: HTMLWG
14
+ 'https://www.w3.org/XML/EXI':
15
+ name: Efficient Extensible Interchange Working Group
16
+ abbrev: EXIWG
17
+ 'https://www.w3.org/2007/OWL':
18
+ name: OWL Working Group
19
+ abbrev: OWLWG
20
+ 'https://www.w3.org/2001/sw/BestPractices':
21
+ name: Semantic Web Best Practices and Deployment Working Group
22
+ abbrev: SWBPD
23
+ 'https://www.w3.org/2000/xp/Group':
24
+ name: XML Protocol Working Group
25
+ 'https://www.w3.org/2011/audio':
26
+ name: Audio Working Group
27
+ 'https://www.w3.org/2001/12/URI':
28
+ name: URI Interest Group
29
+ 'https://www.w3.org/2005/MWI/BPWG':
30
+ name: Mobile Web Best Practices Working Group
31
+ abbrev: BPWG
32
+ 'https://www.w3.org/WAI/EO':
33
+ name: Education and Outreach Working Group
34
+ abbrev: EOWG
35
+ 'https://www.w3.org/2001/sw/WebOnt':
36
+ name: Web-Ontology Working Group
37
+ 'http://www.w3.org/MarkUp/Forms':
38
+ name: Forms Working Group
39
+ 'https://www.w3.org/Style/CSS':
40
+ name: Cascading Style Sheets Working Group
41
+ abbrev: CSSWG
42
+ 'https://www.w3.org/2001/tag':
43
+ name: Technical Architecture Group
44
+ abbrev: TAG
45
+ 'https://www.w3.org/2002/ws/policy':
46
+ name: Web Services Policy Working Group
47
+ 'https://www.w3.org/2008/xmlsec':
48
+ name: XML Security Working Group
49
+ 'https://www.w3.org/2011/prov':
50
+ name: Provenance Working Group
51
+ 'https://www.w3.org/2019/webapps':
52
+ name: Web Applications Working Group
53
+ 'https://www.w3.org/WebPlatform/WG':
54
+ name: Web Applications Working Group
55
+ 'https://www.w3.org/2008/webapps':
56
+ name: Web Applications Working Group
57
+ 'https://www.w3.org/das':
58
+ name: Devices and Sensors Working Group
59
+ abbrev: DAS WG
60
+ 'https://www.w3.org/2007/uwa':
61
+ name: Ubiquitous Web Applications Working Group
62
+ abbrev: UWA
63
+ 'https://www.w3.org/Style/XSL':
64
+ name: Extensible Stylesheet Language Family
65
+ 'https://www.w3.org/XML/Query':
66
+ name: XML Query Working Group
67
+ 'https://www.w3.org/immersive-web':
68
+ name: Immersive Web Working Group
69
+ 'https://www.w3.org/2002/ws/addr':
70
+ name: Web Services Addressing Working Group
71
+ 'https://www.w3.org/WAI/GL':
72
+ name: Accessibility Guidelines Working Group
73
+ abbrev: AG WG
74
+ 'https://www.w3.org/WAI/APA':
75
+ name: Accessible Platform Architectures
76
+ abbrev: APA WG
77
+ 'https://www.w3.org/2011/rdf-wg':
78
+ name: RDF Working Group
79
+ 'https://www.w3.org/Voice':
80
+ name: Voice Browser Working Group
81
+ 'https://www.w3.org/webperf':
82
+ name: Web Performance Working Group
83
+ 'https://www.w3.org/Graphics/SVG/WG':
84
+ name: SVG Working Group
85
+ 'https://www.w3.org/International/core':
86
+ name: Internationalization Working Group
87
+ 'https://www.w3.org/WebCommerce/IG':
88
+ name: Web Commerce Interest Group
89
+ abbrev: WCIG
90
+ 'https://www.w3.org/AudioVideo/TT':
91
+ name: Timed Text Working Group
92
+ abbrev: TTWG
93
+ 'https://www.w3.org/2002/ws/desc':
94
+ name: Web Services Description Working Group
95
+ 'https://www.w3.org/2001/sw/RDFCore':
96
+ name: RDFCore Working Group
97
+ 'https://www.w3.org/2002/ws/arch':
98
+ name: Web Services Architecture Working Group
99
+ 'https://www.w3.org/2011/webappsec':
100
+ name: Web Application Security Working Group
101
+ 'https://www.w3.org/Social/WG':
102
+ name: Social Web Working Group
103
+ 'https://www.w3.org/XML/Core':
104
+ name: XML Core Working Group
105
+ 'https://www.w3.org/2006/07/SWD':
106
+ name: Semantic Web Deployment Working Group
107
+ abbrew: SWD
108
+ 'https://www.w3.org/WAI/PF':
109
+ name: Protocols and Formats Working Group
110
+ abbrev: PFWG
111
+ 'https://www.w3.org/XML/Group/Binary':
112
+ name: XML Binary Characterization Working Group
113
+ 'https://www.w3.org/2012/sysapps':
114
+ name: System Applications Working Group
115
+ 'https://www.w3.org/2017/vc':
116
+ name: Verifiable Credentials Working Group
117
+ abbrev: VCWG
118
+ 'https://www.w3.org/sw':
119
+ name: Service Workers Working Group
120
+ 'https://www.w3.org/XML/SML':
121
+ name: Service Modeling Language
122
+ abbrev: SML WG
123
+ 'https://www.w3.org/WoT/WG':
124
+ name: Web of Things Working Group
125
+ abbrev: WoT WG
126
+ 'https://www.w3.org/2017/dxwg':
127
+ name: Dataset Exchange Working Group
128
+ abbrev: DXWG
129
+ 'https://www.w3.org/groups/wg/webmachinelearning':
130
+ name: Web Machine Learning Working Group
131
+ 'https://www.w3.org/2008/WebVideo/Annotations':
132
+ name: Media Annotations Working Group
133
+ abbrev: MAWG
134
+ 'https://www.w3.org/2001/sw/DataAccess':
135
+ name: SPARQL Working Group
136
+ 'https://www.w3.org/publishing/groups/publ-wg':
137
+ name: Audiobooks Working Group
138
+ 'https://www.w3.org/2013/csvw':
139
+ name: CSV on the Web Working Group
140
+ 'https://www.w3.org/AudioVideo':
141
+ name: Synchronized Multimedia Working Group
142
+ abbrev: SYMM WG
143
+ 'https://www.w3.org/2001/sw/grddl-wg':
144
+ name: GRDDL Working Group
145
+ 'https://www.w3.org/XML/Schema':
146
+ name: XML Schema Working Group
147
+ 'https://www.w3.org/2012/ldp':
148
+ name: Linked Data Platform Working Group
149
+ abbrev: LDP WG
150
+ 'https://www.w3.org/2006/appformats':
151
+ name: Web Application Formats Working Group
152
+ abbrev: WAF WG
153
+ 'https://www.w3.org/2007/powder':
154
+ name: Protocol for Web Description Resources Working Group
155
+ abbrev: POWDER WG
156
+ 'https://www.w3.org/2010/02/rdfa':
157
+ name: RDFa Working Group
158
+ 'https://www.w3.org/2021/sdw':
159
+ name: Spatial Data on the Web Working Group
160
+ abbrev: SDW WG
161
+ 'https://www.w3.org/groups/wg/webrtc':
162
+ name: Web Real-Time Communications Working Group
163
+ 'https://www.w3.org/2001/di/Group':
164
+ name: Device Independence Working Group
165
+ abbrev: DIWG
166
+ 'https://www.w3.org/2001/sw/interest':
167
+ name: Semantic Web Interest Group
168
+ abbrev: SWIG
169
+ 'https://www.w3.org/2016/poe':
170
+ name: Permissions and Obligations Expression Working Group
171
+ abbrev: POE WG
172
+ 'https://www.w3.org/WoT/IG':
173
+ name: WoT Interest Group
174
+ 'https://www.w3.org/Payments/WG':
175
+ name: Web Payments Working Group
176
+ 'https://www.w3.org/dpub/IG':
177
+ name: Digital Publishing Interest Group
178
+ 'https://www.w3.org/2008/geolocation':
179
+ name: Geolocation Working Group
180
+ 'https://www.w3.org/2005/MWI/DDWG':
181
+ name: Mobile Web Initiative Device Description Working Group
182
+ 'https://www.w3.org/2005/rules/wg.html':
183
+ name: RIF Working Group
184
+ 'https://www.w3.org/groups/wg/distributed-tracing':
185
+ name: Distributed Tracing Working Group
186
+ 'https://www.w3.org/publishing/groups/epub-wg':
187
+ name: EPUB 3 Working Group
188
+ 'https://www.w3.org/2010/POI':
189
+ name: Points of Interest Working Group
190
+ abbrev: POI WG
191
+ 'https://www.w3.org/MarkUp':
192
+ name: XHTML2 Working Group
193
+ 'https://www.w3.org/2011/gld':
194
+ name: Government Linked Data Working Group
195
+ abbrev: GLD WG
196
+ 'https://www.w3.org/2014/secondscreen':
197
+ name: Second Screen Working Group
198
+ 'https://www.w3.org/securepay':
199
+ name: Web Payment Security Interest Group
200
+ abbrev: WPSIG
201
+ 'https://www.w3.org/2008/WebVideo/Fragments':
202
+ name: Media Fragments Working Group
203
+ 'https://www.w3.org/2011/mbui':
204
+ name: Model-Based User Interfaces Working Group
205
+ abbrev: MBUI WG
206
+ 'https://www.w3.org/International/its':
207
+ name: ITS Working Group
208
+ 'https://www.w3.org/QA/WG':
209
+ name: Quality Assurance Working Group
210
+ abbrev: QAWG
211
+ 'https://www.w3.org/P3P/Group/Specification':
212
+ name: P3P Specification Working Group
213
+ 'https://www.w3.org/2011/webtv':
214
+ name: Media and Entertainment Interest Group
215
+ 'https://www.w3.org/2001/sw/hcls':
216
+ name: Semantic Web Health Care and Life Sciences Interest Group
217
+ abbrev: HCLS IG
218
+ 'https://www.w3.org/2002/ws/chor':
219
+ name: Web Services Choreography Working Group
220
+ 'https://www.w3.org/2005/MWI/Tests':
221
+ name: Mobile Web Test Suites Working Group
222
+ 'https://www.w3.org/XML/Group/Linking':
223
+ name: XML Linking Working Group
224
+ 'https://www.w3.org/WAI/ARIA':
225
+ name: Accessible Rich Internet Applications Working Group
226
+ abbrev: ARIA WG
227
+ 'https://www.w3.org/wasm':
228
+ name: WebAssembly Working Group
229
+ 'https://www.w3.org/groups/wg/webediting':
230
+ name: Web Editing Working Group
231
+ 'https://www.w3.org/2014/data-shapes':
232
+ name: RDF Data Shapes Working Group
233
+ 'https://www.w3.org/Mobile/IG':
234
+ name: Web and Mobile Interest Group
235
+ 'https://www.w3.org/2019/did-wg':
236
+ name: Decentralized Identifier Working Group
237
+ abbrev: DID WG
238
+ 'https://www.w3.org/egov/IG':
239
+ name: eGovernment Interest Group
240
+ 'https://www.w3.org/WAI/ER':
241
+ name: Evaluation and Repair Tools Working Group
242
+ abbrev: ERT WG
243
+ 'https://www.w3.org/2002/ws/soapjms':
244
+ name: SOAP-JMS Binding Working Group
245
+ 'https://www.w3.org/media-wg':
246
+ name: Media Working Group
247
+ 'https://www.w3.org/2018/json-ld-wg':
248
+ name: JSON-LD Working Group
249
+ 'https://www.w3.org/2020/gpu':
250
+ name: GPU for the Web Working Group
251
+ 'https://www.w3.org/Fonts/WG':
252
+ name: Web Fonts Working Group
253
+ 'https://www.w3.org/groups/wg/auto':
254
+ name: Automotive Working Group
255
+ 'https://www.w3.org/2001/sw/rdb2rdf':
256
+ name: RDB2RDF Working Group
257
+ 'https://www.w3.org/2006/WSC':
258
+ name: Web Security Context Working Group
259
+ 'https://www.w3.org/Graphics/WebCGM/WG':
260
+ name: WebCGM Working Group
261
+ 'https://www.w3.org/XML/Processing':
262
+ name: XML Processing Model Working Group
263
+ 'https://www.w3.org/testing/browser':
264
+ name: Browser Testing and Tools Working Group
265
+ 'https://www.w3.org/2004/CDF':
266
+ name: Compound Document Formats Working Group
267
+ abbrev: CDF WG
268
+ 'https://www.w3.org/2012/webcrypto':
269
+ name: Web Cryptography Working Group
270
+ 'https://www.w3.org/2002/ws/ra':
271
+ name: Web Services Resource Access Working Group
272
+ 'https://www.w3.org/2010/webevents':
273
+ name: Web Events Working Group
274
+ 'https://www.w3.org/WAI/UA':
275
+ name: User Agent Accessibility Guidelines Working Group
276
+ abbrev: UAWG
277
+ 'https://www.w3.org/groups/wg/pointer-events':
278
+ name: Pointer Events Working Group
279
+ 'https://www.w3.org/International/multilingualweb/lt':
280
+ name: MultilingualWeb-LT Working Group
281
+ 'https://www.w3.org/2017/sdwig':
282
+ name: Spatial Data on the Web Interest Group
283
+ abbrev: SDWIG
284
+ 'https://www.w3.org/Privacy':
285
+ name: Privacy Interest Group
286
+ abbrev: PING
287
+ 'https://www.w3.org/Mobile/CCPP/Group':
288
+ name: Composite Capability/Preference Profiles Working Group
289
+ abbrev: CC/PP WG
290
+ 'https://www.w3.org/2008/MW4D':
291
+ name: MW4D Interest Group
292
+ abbrev: MW4D IG
293
+ 'https://www.w3.org/2011/tracking-protection':
294
+ name: Tracking Protection Working Group
295
+ 'https://www.w3.org/annotation':
296
+ name: Annotation Working Group
297
+ 'https://www.w3.org/WAI/AU':
298
+ name: Authoring Tool Accessibility Guidelines Working Group
299
+ abbrev: ATAG WG
300
+ 'https://www.w3.org/MarkUp/CoordGroup':
301
+ name: Hypertext Coordination Group
302
+ abbrev: HCG
303
+ 'https://www.w3.org/2021/miniapps':
304
+ name: MiniApps Working Group
305
+ 'https://www.w3.org/webauthn':
306
+ name: Web Authentication Working Group
307
+ abbrev: WebAuthn WG
308
+ 'https://www.w3.org/2002/ws/sawsdl':
309
+ name: Semantic Annotations for WSDL Working Group
310
+ abbrev: SAWSDL WG
311
+ 'https://www.w3.org/2010/web-notifications':
312
+ name: Web Notification Working Group
313
+ 'https://www.w3.org/2006/webapi':
314
+ name: Web API Working Group
315
+ 'https://www.w3.org/webtransport':
316
+ name: WebTransport Working Group
317
+ 'https://www.w3.org/WAI/RD':
318
+ name: Research and Development Working Group
319
+ abbrev: RDWG
320
+ 'https://www.w3.org/XML/XPPL':
321
+ name: XML Print and Page Layout Working Group
322
+ abbrev: XPPL WG
323
+ 'https://www.w3.org/2007/xmlsec':
324
+ name: XML Security Specifications Maintenance Working Group
325
+ 'https://www.w3.org/2013/dwbp':
326
+ name: Data on the Web Best Practices Working Group
327
+ abbrev: DWBP WG
328
+ 'https://www.w3.org/2012/nfc':
329
+ name: Near Field Communications Working Group
330
+ abbrev: NFC WG
331
+ 'https://www.w3.org/2002/ws/databinding':
332
+ name: XML Schema Patterns for Databinding Working Group
333
+ 'https://www.w3.org/2018/chinese-web-ig':
334
+ name: Chinese Web Interest Group
335
+ 'https://www.w3.org/2016/tvcontrol':
336
+ name: TV Control Working Group
337
+ 'https://www.w3.org/WAI/IndieUI':
338
+ name: Independent User Interface Working Group
339
+ abbrev: Indie UI WG
data/lib/relaton_w3c.rb CHANGED
@@ -7,6 +7,7 @@ require "relaton_w3c/hit"
7
7
  require "relaton_w3c/scrapper"
8
8
  require "relaton_w3c/xml_parser"
9
9
  require "relaton_w3c/hash_converter"
10
+ require "relaton_w3c/data_fethcer"
10
11
 
11
12
  module RelatonW3c
12
13
  class Error < StandardError; end
data/relaton_w3c.gemspec CHANGED
@@ -37,5 +37,9 @@ Gem::Specification.new do |spec|
37
37
  spec.add_development_dependency "vcr"
38
38
  spec.add_development_dependency "webmock"
39
39
 
40
+ spec.add_dependency "linkeddata", "~> 3.1.0"
41
+ spec.add_dependency "mechanize", "~> 2.8.0"
42
+ spec.add_dependency "rdf", "~> 3.1.0"
40
43
  spec.add_dependency "relaton-bib", ">= 1.9.0"
44
+ spec.add_dependency "sparql", "~> 3.1.0"
41
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.0
4
+ version: 1.9.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: 2021-08-26 00:00:00.000000000 Z
11
+ date: 2021-11-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: equivalent-xml
@@ -80,6 +80,48 @@ dependencies:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: linkeddata
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: 3.1.0
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: 3.1.0
97
+ - !ruby/object:Gem::Dependency
98
+ name: mechanize
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: 2.8.0
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: 2.8.0
111
+ - !ruby/object:Gem::Dependency
112
+ name: rdf
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: 3.1.0
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: 3.1.0
83
125
  - !ruby/object:Gem::Dependency
84
126
  name: relaton-bib
85
127
  requirement: !ruby/object:Gem::Requirement
@@ -94,6 +136,20 @@ dependencies:
94
136
  - - ">="
95
137
  - !ruby/object:Gem::Version
96
138
  version: 1.9.0
139
+ - !ruby/object:Gem::Dependency
140
+ name: sparql
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: 3.1.0
146
+ type: :runtime
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: 3.1.0
97
153
  description: 'RelatonIso: retrieve W3C Standards for bibliographic using the IsoBibliographicItem
98
154
  model'
99
155
  email:
@@ -117,6 +173,8 @@ files:
117
173
  - grammars/basicdoc.rng
118
174
  - grammars/biblio.rng
119
175
  - lib/relaton_w3c.rb
176
+ - lib/relaton_w3c/data_fethcer.rb
177
+ - lib/relaton_w3c/data_parser.rb
120
178
  - lib/relaton_w3c/hash_converter.rb
121
179
  - lib/relaton_w3c/hit.rb
122
180
  - lib/relaton_w3c/hit_collection.rb
@@ -125,6 +183,7 @@ files:
125
183
  - lib/relaton_w3c/version.rb
126
184
  - lib/relaton_w3c/w3c_bibliographic_item.rb
127
185
  - lib/relaton_w3c/w3c_bibliography.rb
186
+ - lib/relaton_w3c/workgroups.yaml
128
187
  - lib/relaton_w3c/xml_parser.rb
129
188
  - relaton_w3c.gemspec
130
189
  homepage: https://github.com/relaton/relaton-wc3