relaton-w3c 1.11.5 → 1.11.6

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: c6432e67ef05f183bc0774c4d99d371de778693826020a6202e548c878c4ddd8
4
- data.tar.gz: 4b05d35a0d6c05dafee9046bdf4a5270d61e2bf56ad3e9fa23865c83f439773a
3
+ metadata.gz: faf78f2abf348e9aa6dd74f2f0fe94899d9d6fc34af3368849a818b6dd856e26
4
+ data.tar.gz: c4cabbd9559b9f122f34fbb204f7780606bfc87c9db999492fbdd2b6b02639b3
5
5
  SHA512:
6
- metadata.gz: 656afc278c830f8b31182781e474938efbad280a923239ee8c2a634faa095f7f73638de3a41e2bad8a27a0cb25163cd48ab462dc22ee378d73d734b90883b7fb
7
- data.tar.gz: cc49efd88885d26c0085a47c36b2f1bec4fb1c1d7c1a82545c63b1198f73ed7d94b33c895dd265febce80fe4d08d03f450585af651a13e4e771eb371b3c2a50a
6
+ metadata.gz: cc6e6c80914b8973091795b1f234ea57a49499bb0466ae04a14358c30e526c38a6f607031e9dd0d4963c2caccca26dd9418939c871b4f47016aa094156d783a3
7
+ data.tar.gz: 041625ce66ae2949112bc20856de89b05fd4772c1dd1f3413a3a5b04059ec7cb84f8b92517a3634294080031760fca8795b7ae113bbfae03986f775c5f52acb0
@@ -10,23 +10,4 @@ on:
10
10
 
11
11
  jobs:
12
12
  rake:
13
- name: Test on Ruby ${{ matrix.ruby }} ${{ matrix.os }}
14
- runs-on: ${{ matrix.os }}
15
- continue-on-error: ${{ matrix.experimental }}
16
- strategy:
17
- fail-fast: false
18
- matrix:
19
- ruby: [ '3.0', '2.7', '2.6' ]
20
- os: [ ubuntu-latest, windows-latest, macos-latest ]
21
- experimental: [ false ]
22
- steps:
23
- - uses: actions/checkout@v2
24
- with:
25
- submodules: true
26
-
27
- - uses: ruby/setup-ruby@v1
28
- with:
29
- ruby-version: ${{ matrix.ruby }}
30
- bundler-cache: true
31
-
32
- - run: bundle exec rake
13
+ uses: relaton/support/.github/workflows/rake.yml@master
@@ -28,5 +28,5 @@
28
28
  </author>
29
29
  <date day="27" month="May" year="1998"/>
30
30
  </front>
31
- <seriesInfo name="W3C Recommendation" value="REC-DSig-label"/>
31
+ <seriesInfo name="W3C" value="REC-DSig-label"/>
32
32
  </reference>
@@ -22,5 +22,5 @@
22
22
  </author>
23
23
  <date day="25" month="January" year="2002"/>
24
24
  </front>
25
- <seriesInfo name="W3C Note" value="P3P-rdfschema"/>
25
+ <seriesInfo name="W3C" value="NOTE-P3P-rdfschema"/>
26
26
  </reference>
@@ -34,5 +34,5 @@
34
34
  </author>
35
35
  <date day="16" month="April" year="2002"/>
36
36
  </front>
37
- <seriesInfo name="W3C Recommendation" value="REC-PICS-services"/>
37
+ <seriesInfo name="W3C" value="REC-PICS-services"/>
38
38
  </reference>
@@ -39,5 +39,5 @@
39
39
  </author>
40
40
  <date day="31" month="October" year="1996"/>
41
41
  </front>
42
- <seriesInfo name="W3C Recommendation" value="REC-PICS-labels"/>
42
+ <seriesInfo name="W3C" value="REC-PICS-labels"/>
43
43
  </reference>
@@ -34,5 +34,5 @@
34
34
  </author>
35
35
  <date day="29" month="December" year="1997"/>
36
36
  </front>
37
- <seriesInfo name="W3C Recommendation" value="REC-PICSRules"/>
37
+ <seriesInfo name="W3C" value="REC-PICSRules"/>
38
38
  </reference>
@@ -33,5 +33,5 @@
33
33
  </author>
34
34
  <date day="31" month="October" year="1996"/>
35
35
  </front>
36
- <seriesInfo name="W3C Recommendation" value="REC-PICS-services"/>
36
+ <seriesInfo name="W3C" value="REC-PICS-services"/>
37
37
  </reference>
@@ -35,5 +35,5 @@
35
35
  </author>
36
36
  <date day="18" month="December" year="2001"/>
37
37
  </front>
38
- <seriesInfo value="daml+oil-reference" name="W3C Note"/>
38
+ <seriesInfo value="NOTE-daml+oil-reference" name="W3C"/>
39
39
  </reference>
@@ -52,5 +52,5 @@
52
52
  </author>
53
53
  <date day="8" month="May" year="2000"/>
54
54
  </front>
55
- <seriesInfo value="soap11" name="W3C Note"/>
55
+ <seriesInfo value="NOTE-soap11" name="W3C"/>
56
56
  </reference>
@@ -34,5 +34,5 @@
34
34
  </author>
35
35
  <date day="26" month="June" year="2002"/>
36
36
  </front>
37
- <seriesInfo value="soap12-part1" name="W3C Working Draft"/>
37
+ <seriesInfo value="WD-soap12-part1" name="W3C"/>
38
38
  </reference>
@@ -34,5 +34,5 @@
34
34
  </author>
35
35
  <date day="26" month="June" year="2002"/>
36
36
  </front>
37
- <seriesInfo value="soap12-part2" name="W3C Working Draft"/>
37
+ <seriesInfo value="WD-soap12-part2" name="W3C"/>
38
38
  </reference>
@@ -46,5 +46,5 @@
46
46
  </author>
47
47
  <date day="30" month="March" year="2001"/>
48
48
  </front>
49
- <seriesInfo value="xkms" name="W3C Note"/>
49
+ <seriesInfo value="NOTE-xkms" name="W3C"/>
50
50
  </reference>
@@ -11,5 +11,5 @@
11
11
  </author>
12
12
  <date day="15" month="March" year="2001"/>
13
13
  </front>
14
- <seriesInfo name="W3C Recommendation" value="xpath"/>
14
+ <seriesInfo name="W3C" value="REC-xpath"/>
15
15
  </reference>
@@ -22,5 +22,5 @@
22
22
  </author>
23
23
  <date day="6" month="October" year="2000"/>
24
24
  </front>
25
- <seriesInfo value="xmldsig-core" name="W3C Recommendation"/>
25
+ <seriesInfo value="REC-xmldsig-core" name="W3C"/>
26
26
  </reference>
@@ -16,5 +16,5 @@
16
16
  </author>
17
17
  <date day="2" month="August" year="2002"/>
18
18
  </front>
19
- <seriesInfo value="xmlenc-core" name="W3C Candidate Recommendation"/>
19
+ <seriesInfo value="CR-xmlenc-core" name="W3C"/>
20
20
  </reference>
@@ -18,5 +18,5 @@
18
18
  </author>
19
19
  <date day="16" month="November" year="1999"/>
20
20
  </front>
21
- <seriesInfo name="W3C Recommendation" value="xpath"/>
21
+ <seriesInfo name="W3C" value="REC-xpath"/>
22
22
  </reference>
@@ -68,7 +68,7 @@ module RelatonW3c
68
68
  end
69
69
 
70
70
  #
71
- # Query RDF source for documents
71
+ # Query RDF source for versioned documents
72
72
  #
73
73
  # @return [RDF::Query::Solutions] query results
74
74
  #
@@ -87,6 +87,11 @@ module RelatonW3c
87
87
  data.query sse
88
88
  end
89
89
 
90
+ #
91
+ # Query RDF source for unversioned documents
92
+ #
93
+ # @return [Array<RDF::Query::Solution>] query results
94
+ #
90
95
  def query_unversioned_docs
91
96
  sse = SPARQL.parse(%(
92
97
  PREFIX doc: <http://www.w3.org/2000/10/swap/pim/doc#>
@@ -86,9 +86,10 @@ module RelatonW3c
86
86
  # @return [RelatonBib::TypedTitleStringCollection] title
87
87
  #
88
88
  def parse_title
89
- return [] unless @sol.respond_to?(:title)
90
-
91
- t = RelatonBib::TypedTitleString.new content: @sol.title.to_s
89
+ content = if @sol.respond_to?(:title) then @sol.title.to_s
90
+ else document_versions.max_by { |dv| dv.date.to_s }.title.to_s
91
+ end
92
+ t = RelatonBib::TypedTitleString.new content: content
92
93
  RelatonBib::TypedTitleStringCollection.new [t]
93
94
  end
94
95
 
@@ -99,7 +100,6 @@ module RelatonW3c
99
100
  #
100
101
  def parse_link
101
102
  link = @sol.respond_to?(:link) ? @sol.link : @sol.version_of
102
-
103
103
  [RelatonBib::TypedUri.new(type: "src", content: link.to_s)]
104
104
  end
105
105
 
@@ -109,9 +109,7 @@ module RelatonW3c
109
109
  # @return [Arra<RelatonBib::DocumentIdentifier>] docidentifier
110
110
  #
111
111
  def parse_docid
112
- return [] unless @sol.respond_to?(:link)
113
-
114
- id = pub_id(@sol.link)
112
+ id = @sol.respond_to?(:link) ? pub_id(@sol.link) : pub_id(@sol.version_of)
115
113
  [RelatonBib::DocumentIdentifier.new(type: "W3C", id: id, primary: true)]
116
114
  end
117
115
 
@@ -221,10 +219,16 @@ module RelatonW3c
221
219
  def parse_relation
222
220
  if @sol.respond_to?(:link)
223
221
  relations + editor_drafts
224
- else document_versions
222
+ else
223
+ document_versions.map { |r| create_relation(r.link.to_s, "hasEdition") }
225
224
  end
226
225
  end
227
226
 
227
+ #
228
+ # Create relations
229
+ #
230
+ # @return [Array<RelatonBib::DocumentRelation>] relations
231
+ #
228
232
  def relations # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
229
233
  {
230
234
  "doc:obsoletes" => { type: "obsoletes" },
@@ -234,14 +238,16 @@ module RelatonW3c
234
238
  ":previousEdition" => { type: "editionOf" },
235
239
  }.reduce([]) do |acc, (predicate, tp)|
236
240
  acc + relation_query(predicate).map do |r|
237
- fr = RelatonBib::LocalizedString.new pub_id(r.rel.to_s)
238
- bib = W3cBibliographicItem.new formattedref: fr
239
- tp[:description] = RelatonBib::FormattedString.new content: tp[:description] if tp[:description]
240
- RelatonBib::DocumentRelation.new(**tp, bibitem: bib)
241
+ create_relation(r.rel.to_s, tp[:type], tp[:description])
241
242
  end
242
243
  end
243
244
  end
244
245
 
246
+ #
247
+ # Parse editor drafts relation
248
+ #
249
+ # @return [Array<RelatonBib::DocumentRelation>] relation
250
+ #
245
251
  def editor_drafts # rubocop:disable Metrics/MethodLength
246
252
  sse = SPARQL.parse(%(
247
253
  PREFIX : <http://www.w3.org/2001/02pd/rec54#>
@@ -250,15 +256,17 @@ module RelatonW3c
250
256
  WHERE { <#{@sol.link}> :ED ?rel . }
251
257
  ))
252
258
  @fetcher.data.query(sse).map do |s|
253
- fr = RelatonBib::LocalizedString.new pub_id(s.rel.to_s)
254
- bib = W3cBibliographicItem.new formattedref: fr
255
- desc = RelatonBib::FormattedString.new content: "Editor's draft"
256
- RelatonBib::DocumentRelation.new(
257
- type: "hasDraft", description: desc, bibitem: bib,
258
- )
259
+ create_relation(s.rel.to_s, "hasDraft", "Editor's draft")
259
260
  end
260
261
  end
261
262
 
263
+ #
264
+ # Query for relations
265
+ #
266
+ # @param [String] predicate relation type
267
+ #
268
+ # @return [RDF::Query::Solutions] query result
269
+ #
262
270
  def relation_query(predicate)
263
271
  sse = SPARQL.parse(%(
264
272
  PREFIX : <http://www.w3.org/2001/02pd/rec54#>
@@ -270,19 +278,43 @@ module RelatonW3c
270
278
  @fetcher.data.query(sse).order_by(:rel)
271
279
  end
272
280
 
273
- def document_versions
274
- sse = SPARQL.parse(%(
275
- PREFIX doc: <http://www.w3.org/2000/10/swap/pim/doc#>
276
- SELECT ?link
277
- WHERE { ?link doc:versionOf <#{@sol.version_of}> }
278
- ))
279
- @fetcher.data.query(sse).map do |r|
280
- fref = RelatonBib::FormattedRef.new content: pub_id(r.link)
281
- bib = W3cBibliographicItem.new formattedref: fref
282
- RelatonBib::DocumentRelation.new(type: "hasEdition", bibitem: bib)
281
+ #
282
+ # Query document versions relations
283
+ #
284
+ # @return [RDF::Query::Solutions] query results
285
+ #
286
+ def document_versions # rubocop:disable Metrics/MethodLength
287
+ @document_versions ||= begin
288
+ sse = SPARQL.parse(%(
289
+ PREFIX : <http://www.w3.org/2001/02pd/rec54#>
290
+ PREFIX dc: <http://purl.org/dc/elements/1.1/>
291
+ PREFIX doc: <http://www.w3.org/2000/10/swap/pim/doc#>
292
+ PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
293
+ SELECT ?link ?title ?date
294
+ WHERE { ?link doc:versionOf <#{@sol.version_of}> ; dc:title ?title ; dc:date ?date }
295
+ ))
296
+ @fetcher.data.query(sse)
283
297
  end
284
298
  end
285
299
 
300
+ #
301
+ # Create relation
302
+ #
303
+ # @param [String] url relation URL
304
+ # @param [String] type relation type
305
+ # @param [String, nil] desc relation description
306
+ #
307
+ # @return [RelatonBib::DocumentRelation] <description>
308
+ #
309
+ def create_relation(url, type, desc = nil)
310
+ id = pub_id(url)
311
+ fref = RelatonBib::FormattedRef.new content: id
312
+ docid = RelatonBib::DocumentIdentifier.new(type: "W3C", id: id, primary: true)
313
+ bib = W3cBibliographicItem.new formattedref: fref, docid: [docid]
314
+ dsc = RelatonBib::FormattedString.new content: desc if desc
315
+ RelatonBib::DocumentRelation.new(type: type, bibitem: bib, description: dsc)
316
+ end
317
+
286
318
  #
287
319
  # Parse formattedref
288
320
  #
@@ -1,3 +1,3 @@
1
1
  module RelatonW3c
2
- VERSION = "1.11.5".freeze
2
+ VERSION = "1.11.6".freeze
3
3
  end
@@ -103,6 +103,8 @@
103
103
  name: Web Services Architecture Working Group
104
104
  'https://www.w3.org/2011/webappsec':
105
105
  name: Web Application Security Working Group
106
+ 'https://www.w3.org/groups/wg/webappsec':
107
+ name: Web Application Security Working Group
106
108
  'https://www.w3.org/Social/WG':
107
109
  name: Social Web Working Group
108
110
  'https://www.w3.org/XML/Core':
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.11.5
4
+ version: 1.11.6
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-05-13 00:00:00.000000000 Z
11
+ date: 2022-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: equivalent-xml