relaton-ogc 1.16.3 → 1.17.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/docs.json +29488 -0
- data/grammars/basicdoc.rng +56 -37
- data/grammars/biblio.rng +22 -0
- data/lib/relaton_ogc/document_type.rb +22 -0
- data/lib/relaton_ogc/hash_converter.rb +19 -14
- data/lib/relaton_ogc/ogc_bibliographic_item.rb +1 -9
- data/lib/relaton_ogc/scrapper.rb +14 -6
- data/lib/relaton_ogc/version.rb +1 -1
- data/lib/relaton_ogc.rb +1 -0
- data/relaton_ogc.gemspec +1 -1
- metadata +6 -4
data/grammars/basicdoc.rng
CHANGED
@@ -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
|
-
<
|
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
|
-
<
|
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
|
-
<
|
902
|
-
|
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
|
-
|
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
|
-
|
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>
|
@@ -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
|
-
|
3
|
-
|
4
|
-
|
2
|
+
module HashConverter
|
3
|
+
include RelatonBib::HashConverter
|
4
|
+
extend self
|
5
5
|
|
6
|
-
|
7
|
-
def editorialgroup_hash_to_bib(ret)
|
8
|
-
eg = ret[:editorialgroup]
|
9
|
-
return unless eg
|
6
|
+
private
|
10
7
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
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
|
-
|
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 }
|
data/lib/relaton_ogc/scrapper.rb
CHANGED
@@ -40,8 +40,8 @@ module RelatonOgc
|
|
40
40
|
type: "standard",
|
41
41
|
title: fetch_title(hit["title"]),
|
42
42
|
docid: fetch_docid(hit["identifier"]),
|
43
|
-
link: fetch_link(hit
|
44
|
-
doctype: type[:type],
|
43
|
+
link: fetch_link(hit),
|
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"]),
|
@@ -72,11 +72,19 @@ module RelatonOgc
|
|
72
72
|
[RelatonBib::DocumentIdentifier.new(id: identifier, type: "OGC", primary: true)]
|
73
73
|
end
|
74
74
|
|
75
|
-
# @param
|
75
|
+
# @param hit [Hash]
|
76
76
|
# @return [Array>RelatonBib::TypedUri>]
|
77
|
-
def fetch_link(
|
78
|
-
|
79
|
-
|
77
|
+
def fetch_link(hit)
|
78
|
+
link = []
|
79
|
+
link << RelatonBib::TypedUri.new(type: "src", content: hit["URI"]) if hit["URI"]
|
80
|
+
return link unless hit["URL"]
|
81
|
+
|
82
|
+
type = hit["URL"].end_with?("pdf") ? "pdf" : "obp"
|
83
|
+
link << RelatonBib::TypedUri.new(type: type, content: hit["URL"])
|
84
|
+
end
|
85
|
+
|
86
|
+
def fetch_doctype(type)
|
87
|
+
DocumentType.new(type: type)
|
80
88
|
end
|
81
89
|
|
82
90
|
# @param type [String]
|
data/lib/relaton_ogc/version.rb
CHANGED
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
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.
|
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-
|
11
|
+
date: 2023-12-07 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.
|
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.
|
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
|