relaton-ogc 1.16.3 → 1.17.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -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>
data/grammars/biblio.rng CHANGED
@@ -942,6 +942,7 @@
942
942
  <value>obsoleted</value>
943
943
  <value>confirmed</value>
944
944
  <value>updated</value>
945
+ <value>corrected</value>
945
946
  <value>issued</value>
946
947
  <value>transmitted</value>
947
948
  <value>copied</value>
@@ -0,0 +1,22 @@
1
+ module RelatonOgc
2
+ class DocumentType < RelatonBib::DocumentType
3
+ DOCTYPES = %w[
4
+ abstract-specification-topic best-practice
5
+ change-request-supporting-document
6
+ community-practice community-standard discussion-paper engineering-report
7
+ other policy reference-model release-notes standard user-guide white-paper
8
+ test-suite draft-standard
9
+ ].freeze
10
+
11
+ def initialize(type:, abbreviation: nil)
12
+ check_type type
13
+ super
14
+ end
15
+
16
+ def check_type(type)
17
+ unless DOCTYPES.include? type
18
+ Util.warn "WARNING: invalid doctype: `#{type}`"
19
+ end
20
+ end
21
+ end
22
+ end
@@ -1,20 +1,25 @@
1
1
  module RelatonOgc
2
- class HashConverter < RelatonBib::HashConverter
3
- class << self
4
- private
2
+ module HashConverter
3
+ include RelatonBib::HashConverter
4
+ extend self
5
5
 
6
- # @param ret [Hash]
7
- def editorialgroup_hash_to_bib(ret)
8
- eg = ret[:editorialgroup]
9
- return unless eg
6
+ private
10
7
 
11
- ret[:editorialgroup] = EditorialGroup.new(
12
- committee: eg[:committee],
13
- subcommittee: eg[:subcommittee],
14
- workgroup: eg[:workgroup],
15
- secretariat: eg[:secretariat],
16
- )
17
- end
8
+ # @param ret [Hash]
9
+ def editorialgroup_hash_to_bib(ret)
10
+ eg = ret[:editorialgroup]
11
+ return unless eg
12
+
13
+ ret[:editorialgroup] = EditorialGroup.new(
14
+ committee: eg[:committee],
15
+ subcommittee: eg[:subcommittee],
16
+ workgroup: eg[:workgroup],
17
+ secretariat: eg[:secretariat],
18
+ )
19
+ end
20
+
21
+ def create_doctype(**args)
22
+ DocumentType.new(**args)
18
23
  end
19
24
  end
20
25
  end
@@ -1,13 +1,5 @@
1
1
  module RelatonOgc
2
2
  class OgcBibliographicItem < RelatonBib::BibliographicItem
3
- TYPES = %w[
4
- abstract-specification-topic best-practice
5
- change-request-supporting-document
6
- community-practice community-standard discussion-paper engineering-report
7
- other policy reference-model release-notes standard user-guide white-paper
8
- test-suite
9
- ].freeze
10
-
11
3
  SUBTYPES = %w[
12
4
  conceptual-model conceptual-model-and-encoding
13
5
  conceptual-model-and-implementation encoding extension implementation
@@ -56,7 +48,7 @@ module RelatonOgc
56
48
  def to_xml(**opts) # rubocop:disable Metrics/AbcSize
57
49
  super(**opts) do |b|
58
50
  ext = b.ext do
59
- b.doctype doctype if doctype
51
+ doctype&.to_xml b
60
52
  b.subdoctype subdoctype if subdoctype
61
53
  editorialgroup&.to_xml b
62
54
  ics.each { |i| i.to_xml b }
@@ -41,7 +41,7 @@ module RelatonOgc
41
41
  title: fetch_title(hit["title"]),
42
42
  docid: fetch_docid(hit["identifier"]),
43
43
  link: fetch_link(hit["URL"]),
44
- doctype: type[:type],
44
+ doctype: fetch_doctype(type[:type]),
45
45
  subdoctype: type[:subtype],
46
46
  docstatus: fetch_status(type[:stage]),
47
47
  edition: fetch_edition(hit["identifier"]),
@@ -79,6 +79,10 @@ module RelatonOgc
79
79
  [RelatonBib::TypedUri.new(type: "obp", content: url)]
80
80
  end
81
81
 
82
+ def fetch_doctype(type)
83
+ DocumentType.new(type: type)
84
+ end
85
+
82
86
  # @param type [String]
83
87
  # @return [String]
84
88
  def fetch_type(type)
@@ -1,3 +1,3 @@
1
1
  module RelatonOgc
2
- VERSION = "1.16.3".freeze
2
+ VERSION = "1.17.0".freeze
3
3
  end
data/lib/relaton_ogc.rb CHANGED
@@ -3,6 +3,7 @@ require "relaton_iso_bib"
3
3
  require "relaton_ogc/version"
4
4
  require "relaton_ogc/config"
5
5
  require "relaton_ogc/util"
6
+ require "relaton_ogc/document_type"
6
7
  require "relaton_ogc/ogc_bibliographic_item"
7
8
  require "relaton_ogc/ogc_bibliography"
8
9
  require "relaton_ogc/data_fetcher"
data/relaton_ogc.gemspec CHANGED
@@ -27,5 +27,5 @@ Gem::Specification.new do |spec|
27
27
 
28
28
  spec.add_dependency "faraday", "~> 2.7.0"
29
29
  spec.add_dependency "relaton-index", "~> 0.2.0"
30
- spec.add_dependency "relaton-iso-bib", "~> 1.16.0"
30
+ spec.add_dependency "relaton-iso-bib", "~> 1.17.0"
31
31
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-ogc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.16.3
4
+ version: 1.17.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: 2023-10-18 00:00:00.000000000 Z
11
+ date: 2023-11-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 1.16.0
47
+ version: 1.17.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 1.16.0
54
+ version: 1.17.0
55
55
  description: 'RelatonOgc: retrieve OGC Standards for bibliographic use using the OgcBibliographicItem
56
56
  model'
57
57
  email:
@@ -72,6 +72,7 @@ files:
72
72
  - bin/console
73
73
  - bin/rspec
74
74
  - bin/setup
75
+ - docs.json
75
76
  - grammars/basicdoc.rng
76
77
  - grammars/biblio-standoc.rng
77
78
  - grammars/biblio.rng
@@ -80,6 +81,7 @@ files:
80
81
  - lib/relaton_ogc.rb
81
82
  - lib/relaton_ogc/config.rb
82
83
  - lib/relaton_ogc/data_fetcher.rb
84
+ - lib/relaton_ogc/document_type.rb
83
85
  - lib/relaton_ogc/editorial_group.rb
84
86
  - lib/relaton_ogc/hash_converter.rb
85
87
  - lib/relaton_ogc/hit.rb