relaton-w3c 1.16.1 → 1.17.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: 0440b77d73c24a978935bfba1bd94b9ddc58c8ebcf90cc229c4a5339a901c18c
4
- data.tar.gz: a4b299f58a4c4c4b79946ef56e075cbff224fb8f6a639e11958a4dba996eeb5d
3
+ metadata.gz: 93cc28a3d425ad3b7eae1f905690747b2a700cd54eb6f97506cb47d4007970fc
4
+ data.tar.gz: ea68818b5814465e9610bb271d32f5f753a8f424db0c4669986b8bc7879758bf
5
5
  SHA512:
6
- metadata.gz: 81e2bd181d0a55948a36d831d39ebb13edfc7a0d28bcff8e035f5e6544305b67bd6a28db4d647c45417ff4504aa8dde2459bd7b848b274c53c286fcc08edc360
7
- data.tar.gz: ff49763539341324fc1d0e612d90404b52b25d11e9b2141cc7801e050abfb81e03c8c94de29c4278af452415eaf92293467b7d9817a87fbb2122fd0177a5b038
6
+ metadata.gz: cb28efbe7ab797ff44c0af784bb71f55fe61b19bb63684d0096be2cb9f716ce27ae3f23f18411a570456036b66f2e2ded4460a2a7cadf3206c42895e60171b87
7
+ data.tar.gz: f0cf0e02cd8809328e1f929e346a2a5c47b27be42886419e1a99a0a8afeb2422efe12fbf5ef39fd23615f63da8ff29527260cdaac9de0be7b48849c7c09dec87
@@ -346,6 +346,8 @@
346
346
  <ref name="keyword"/>
347
347
  <ref name="xref"/>
348
348
  <ref name="hyperlink"/>
349
+ <ref name="index"/>
350
+ <ref name="index-xref"/>
349
351
  </choice>
350
352
  </oneOrMore>
351
353
  </element>
@@ -623,6 +625,8 @@
623
625
  <ref name="eref"/>
624
626
  <ref name="xref"/>
625
627
  <ref name="hyperlink"/>
628
+ <ref name="index"/>
629
+ <ref name="index-xref"/>
626
630
  </choice>
627
631
  </zeroOrMore>
628
632
  </element>
@@ -636,6 +640,8 @@
636
640
  <ref name="eref"/>
637
641
  <ref name="xref"/>
638
642
  <ref name="hyperlink"/>
643
+ <ref name="index"/>
644
+ <ref name="index-xref"/>
639
645
  </choice>
640
646
  </zeroOrMore>
641
647
  </element>
@@ -648,6 +654,8 @@
648
654
  <ref name="eref"/>
649
655
  <ref name="xref"/>
650
656
  <ref name="hyperlink"/>
657
+ <ref name="index"/>
658
+ <ref name="index-xref"/>
651
659
  </choice>
652
660
  </zeroOrMore>
653
661
  </element>
@@ -655,7 +663,11 @@
655
663
  <define name="keyword">
656
664
  <element name="keyword">
657
665
  <zeroOrMore>
658
- <ref name="PureTextElement"/>
666
+ <choice>
667
+ <ref name="PureTextElement"/>
668
+ <ref name="index"/>
669
+ <ref name="index-xref"/>
670
+ </choice>
659
671
  </zeroOrMore>
660
672
  </element>
661
673
  </define>
@@ -676,7 +688,11 @@
676
688
  <define name="strike">
677
689
  <element name="strike">
678
690
  <zeroOrMore>
679
- <ref name="PureTextElement"/>
691
+ <choice>
692
+ <ref name="PureTextElement"/>
693
+ <ref name="index"/>
694
+ <ref name="index-xref"/>
695
+ </choice>
680
696
  </zeroOrMore>
681
697
  </element>
682
698
  </define>
@@ -898,44 +914,47 @@
898
914
  -->
899
915
  <define name="image">
900
916
  <element name="image">
901
- <attribute name="id">
902
- <data type="ID"/>
917
+ <ref name="Image"/>
918
+ </element>
919
+ </define>
920
+ <define name="Image">
921
+ <attribute name="id">
922
+ <data type="ID"/>
923
+ </attribute>
924
+ <attribute name="src">
925
+ <data type="anyURI"/>
926
+ </attribute>
927
+ <attribute name="mimetype"/>
928
+ <optional>
929
+ <attribute name="filename"/>
930
+ </optional>
931
+ <optional>
932
+ <attribute name="width">
933
+ <choice>
934
+ <data type="int"/>
935
+ <value>auto</value>
936
+ </choice>
903
937
  </attribute>
904
- <attribute name="src">
938
+ </optional>
939
+ <optional>
940
+ <attribute name="height">
941
+ <choice>
942
+ <data type="int"/>
943
+ <value>auto</value>
944
+ </choice>
945
+ </attribute>
946
+ </optional>
947
+ <optional>
948
+ <attribute name="alt"/>
949
+ </optional>
950
+ <optional>
951
+ <attribute name="title"/>
952
+ </optional>
953
+ <optional>
954
+ <attribute name="longdesc">
905
955
  <data type="anyURI"/>
906
956
  </attribute>
907
- <attribute name="mimetype"/>
908
- <optional>
909
- <attribute name="filename"/>
910
- </optional>
911
- <optional>
912
- <attribute name="width">
913
- <choice>
914
- <data type="int"/>
915
- <value>auto</value>
916
- </choice>
917
- </attribute>
918
- </optional>
919
- <optional>
920
- <attribute name="height">
921
- <choice>
922
- <data type="int"/>
923
- <value>auto</value>
924
- </choice>
925
- </attribute>
926
- </optional>
927
- <optional>
928
- <attribute name="alt"/>
929
- </optional>
930
- <optional>
931
- <attribute name="title"/>
932
- </optional>
933
- <optional>
934
- <attribute name="longdesc">
935
- <data type="anyURI"/>
936
- </attribute>
937
- </optional>
938
- </element>
957
+ </optional>
939
958
  </define>
940
959
  <define name="video">
941
960
  <element name="video">
data/grammars/biblio.rng CHANGED
@@ -348,6 +348,9 @@
348
348
  <zeroOrMore>
349
349
  <ref name="contact"/>
350
350
  </zeroOrMore>
351
+ <optional>
352
+ <ref name="logo"/>
353
+ </optional>
351
354
  </element>
352
355
  </define>
353
356
  <define name="orgname">
@@ -366,6 +369,21 @@
366
369
  </choice>
367
370
  </element>
368
371
  </define>
372
+ <define name="logo">
373
+ <element name="logo">
374
+ <ref name="image"/>
375
+ </element>
376
+ </define>
377
+ <define name="depiction">
378
+ <element name="depiction">
379
+ <optional>
380
+ <attribute name="scope"/>
381
+ </optional>
382
+ <zeroOrMore>
383
+ <ref name="image"/>
384
+ </zeroOrMore>
385
+ </element>
386
+ </define>
369
387
  <define name="NameWithVariants">
370
388
  <element name="primary">
371
389
  <ref name="LocalizedString"/>
@@ -752,6 +770,9 @@
752
770
  <optional>
753
771
  <ref name="validity"/>
754
772
  </optional>
773
+ <optional>
774
+ <ref name="depiction"/>
775
+ </optional>
755
776
  </define>
756
777
  <define name="ReducedBibliographicItem">
757
778
  <optional>
@@ -942,6 +963,7 @@
942
963
  <value>obsoleted</value>
943
964
  <value>confirmed</value>
944
965
  <value>updated</value>
966
+ <value>corrected</value>
945
967
  <value>issued</value>
946
968
  <value>transmitted</value>
947
969
  <value>copied</value>
@@ -222,7 +222,8 @@ module RelatonW3c
222
222
  # @return [String, nil] doctype
223
223
  #
224
224
  def parse_doctype
225
- DOCTYPES[type] || DOCTYPES[type_from_link]
225
+ type = DOCTYPES[type] || DOCTYPES[type_from_link]
226
+ DocumentType.new(type: type) if type
226
227
  end
227
228
 
228
229
  #
@@ -0,0 +1,16 @@
1
+ module RelatonW3c
2
+ class DocumentType < RelatonBib::DocumentType
3
+ DOCTYPES = %w[groupNote technicalReport].freeze
4
+
5
+ def initialize(type:, abbreviation: nil)
6
+ check_type type
7
+ super
8
+ end
9
+
10
+ def check_type(type)
11
+ unless DOCTYPES.include? type
12
+ Util.warn "WARNING: invalid doctype: `#{type}`"
13
+ end
14
+ end
15
+ end
16
+ end
@@ -1,11 +1,12 @@
1
1
  module RelatonW3c
2
- class HashConverter < RelatonBib::HashConverter
3
- class << self
4
- # @param item_hash [Hash]
5
- # @return [RelatonW3c::W3cBibliographicItem]
6
- def bib_item(item_hash)
7
- W3cBibliographicItem.new(**item_hash)
8
- end
2
+ module HashConverter
3
+ include RelatonBib::HashConverter
4
+ extend self
5
+
6
+ # @param item_hash [Hash]
7
+ # @return [RelatonW3c::W3cBibliographicItem]
8
+ def bib_item(item_hash)
9
+ W3cBibliographicItem.new(**item_hash)
9
10
  end
10
11
  end
11
12
  end
@@ -0,0 +1,7 @@
1
+ module RelatonW3c
2
+ class Hit
3
+ def initialize(rows)
4
+ @array = rows.map { |r| Hit.new(**r) }
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module RelatonW3c
2
+ class HitCollection < RelatonBib::HitCollection
3
+ def initialize(rows)
4
+ @array = rows.map { |r| Hit.new(**r) }
5
+ end
6
+ end
7
+ end
@@ -1,6 +1,6 @@
1
1
  module RelatonW3c
2
2
  class PubId
3
- PARTS = %i[code stage type date suff].freeze
3
+ PARTS = %i[code stage type year date suff].freeze
4
4
 
5
5
  PARTS.each { |part| attr_accessor part }
6
6
 
@@ -19,12 +19,14 @@ module RelatonW3c
19
19
  %r{
20
20
  (?:^|/)(?:(?:(?<stage>WD|CRD|CR|PR|PER|REC|SPSD|OBSL|RET)|(?<type>D?NOTE|TR))[\s/-])?
21
21
  (?<code>\w+(?:[+-][\w.]+)*?)
22
- (?:-(?<date>\d{8}|\d{6}|\d{4}))?
22
+ (?:-(?<year>\d{4}))?
23
+ (?:-(?<date>\d{8}|\d{6}))?
23
24
  (?:/(?<suff>\w+))?(?:$|/)
24
25
  }xi =~ docnumber
25
26
  entry = { code: code }
26
27
  entry[:stage] = stage if stage
27
28
  entry[:type] = type if type && type != "TR"
29
+ entry[:year] = year if year
28
30
  entry[:date] = date if date
29
31
  entry[:suff] = suff if suff
30
32
  new(**entry)
@@ -39,7 +41,8 @@ module RelatonW3c
39
41
  #
40
42
  def ==(other) # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
41
43
  other[:code].casecmp?(code) && other[:stage] == stage && other[:type] == type &&
42
- (date.nil? || other[:date] == date) && (suff.nil? || other[:suff]&.casecmp?(suff))
44
+ (year.nil? || other[:year] == year) && (date.nil? || other[:date] == date) &&
45
+ (suff.nil? || other[:suff]&.casecmp?(suff))
43
46
  end
44
47
 
45
48
  #
@@ -1,3 +1,3 @@
1
1
  module RelatonW3c
2
- VERSION = "1.16.1".freeze
2
+ VERSION = "1.17.1".freeze
3
3
  end
@@ -1,17 +1,8 @@
1
1
  module RelatonW3c
2
2
  class W3cBibliographicItem < RelatonBib::BibliographicItem
3
- TYPES = %w[
4
- candidateRecommendation groupNote proposedEditedRecommendation
5
- proposedRecommendation recommendation retired workingDraft technicalReport
6
- ].freeze
7
-
8
- # @param doctype [String]
9
- def initialize(**args)
10
- if args[:doctype] && !TYPES.include?(args[:doctype])
11
- Util.warn "Invalid document type: `#{args[:doctype]}`"
12
- end
13
- super
14
- end
3
+ # def initialize(**args)
4
+ # super
5
+ # end
15
6
 
16
7
  #
17
8
  # Fetch flavor schema version
@@ -16,7 +16,7 @@ module RelatonW3c
16
16
  index = Relaton::Index.find_or_create(
17
17
  :W3C, url: "#{SOURCE}#{INDEX}.zip", file: "#{INDEX}.yaml", id_keys: PubId::PARTS
18
18
  )
19
- row = index.search { |r| pubid == r[:id] }.first
19
+ row = index.search { |r| pubid == r[:id] }.sort_by{ |r| (r[:id][:date] || r[:id][:year]).to_i }.last
20
20
  return unless row
21
21
 
22
22
  url = "#{SOURCE}#{row[:file]}"
@@ -46,7 +46,7 @@ module RelatonW3c
46
46
  return
47
47
  end
48
48
 
49
- found = result.docnumber
49
+ found = result.docidentifier.first.id
50
50
  Util.warn "(#{ref}) Found: `#{found}`"
51
51
  result
52
52
  end
@@ -30,10 +30,10 @@
30
30
  name: Mobile Web Best Practices Working Group
31
31
  abbrev: BPWG
32
32
  'www.w3.org/WAI/EO':
33
- name: Education and Outreach Working Group
33
+ name: Education and Outreach Working Group
34
34
  abbrev: EOWG
35
35
  'www.w3.org/WAI/about/groups/eowg':
36
- name: Education and Outreach Working Group
36
+ name: Education and Outreach Working Group
37
37
  abbrev: EOWG
38
38
  'www.w3.org/2001/sw/WebOnt':
39
39
  name: Web-Ontology Working Group
@@ -208,7 +208,7 @@
208
208
  'www.w3.org/2008/WebVideo/Fragments':
209
209
  name: Media Fragments Working Group
210
210
  'www.w3.org/2011/mbui':
211
- name: Model-Based User Interfaces Working Group
211
+ name: Model-Based User Interfaces Working Group
212
212
  abbrev: MBUI WG
213
213
  'www.w3.org/International/its':
214
214
  name: ITS Working Group
@@ -482,4 +482,27 @@
482
482
  name: HTML Working Group
483
483
  abbrev: HTMLWG
484
484
  'www.w3.org/groups/wg/audio':
485
- name: Audio Working Group
485
+ name: Audio Working Group
486
+ 'www.w3.org/groups/wg/webperf':
487
+ name: Web Performance Working Group
488
+ 'www.w3.org/groups/wg/webauthn':
489
+ name: Web Authentication Working Group
490
+ abbrev: WebAuthn WG
491
+ 'www.w3.org/Privacy/IG':
492
+ name: Privacy Interest Group
493
+ abbrev: PING
494
+ 'www.w3.org/groups/wg/json-ld':
495
+ name: JSON-LD Working Group
496
+ 'www.w3.org/groups/wg/rdf-star':
497
+ name: RDF-star Working Group
498
+ 'www.w3.org/groups/wg/png':
499
+ name: Portable Network Graphics (PNG) Working Group
500
+ abbrev: PNG WG
501
+ 'www.w3.org/web-networks':
502
+ name: Web & Networks Interest Group
503
+ 'www.w3.org/groups/wg/pm':
504
+ name: Publishing Maintenance Working Group
505
+ abbrev: PM WG
506
+ 'www.w3.org/groups/wg/rch':
507
+ name: RDF Dataset Canonicalization and Hash Working Group
508
+ abbrev: RCH WG
@@ -8,10 +8,10 @@ module RelatonW3c
8
8
  # @returtn [Hash]
9
9
  def item_data(item)
10
10
  data = super
11
- ext = item.at "./ext"
12
- return data unless ext
11
+ # ext = item.at "./ext"
12
+ # return data unless ext
13
13
 
14
- data[:doctype] = ext.at("./doctype")&.text
14
+ # data[:doctype] = ext.at("./doctype")&.text
15
15
  data
16
16
  end
17
17
 
data/lib/relaton_w3c.rb CHANGED
@@ -3,6 +3,7 @@ require "relaton/index"
3
3
  require "relaton_w3c/version"
4
4
  require "relaton_w3c/config"
5
5
  require "relaton_w3c/util"
6
+ require "relaton_w3c/document_type"
6
7
  require "relaton_w3c/w3c_bibliography"
7
8
  require "relaton_w3c/w3c_bibliographic_item"
8
9
  require "relaton_w3c/xml_parser"
data/relaton_w3c.gemspec CHANGED
@@ -34,9 +34,9 @@ Gem::Specification.new do |spec|
34
34
  spec.add_dependency "linkeddata", "~> 3.2.0"
35
35
  spec.add_dependency "mechanize", "~> 2.8.0"
36
36
  spec.add_dependency "rdf", "~> 3.2.0"
37
- spec.add_dependency "rdf-normalize", "~> 0.5.0"
38
- spec.add_dependency "relaton-bib", "~> 1.16.0"
39
- spec.add_dependency "relaton-index", "~> 0.2.4"
37
+ spec.add_dependency "rdf-normalize", "~> 0.6.0"
38
+ spec.add_dependency "relaton-bib", "~> 1.17.0"
39
+ spec.add_dependency "relaton-index", "~> 0.2.8"
40
40
  spec.add_dependency "rubyzip", "~> 2.3.0"
41
41
  spec.add_dependency "shex", "~> 0.7.0"
42
42
  spec.add_dependency "sparql", "~> 3.2.0"
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.16.1
4
+ version: 1.17.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: 2023-10-18 00:00:00.000000000 Z
11
+ date: 2023-12-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: linkeddata
@@ -58,42 +58,42 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 0.5.0
61
+ version: 0.6.0
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 0.5.0
68
+ version: 0.6.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: relaton-bib
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 1.16.0
75
+ version: 1.17.0
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 1.16.0
82
+ version: 1.17.0
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: relaton-index
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: 0.2.4
89
+ version: 0.2.8
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: 0.2.4
96
+ version: 0.2.8
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rubyzip
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -168,7 +168,10 @@ files:
168
168
  - lib/relaton_w3c/data_fetcher.rb
169
169
  - lib/relaton_w3c/data_index.rb
170
170
  - lib/relaton_w3c/data_parser.rb
171
+ - lib/relaton_w3c/document_type.rb
171
172
  - lib/relaton_w3c/hash_converter.rb
173
+ - lib/relaton_w3c/hit.rb
174
+ - lib/relaton_w3c/hit_collection.rb
172
175
  - lib/relaton_w3c/processor.rb
173
176
  - lib/relaton_w3c/pubid.rb
174
177
  - lib/relaton_w3c/util.rb