relaton-calconnect 1.8.0 → 1.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +1 -11
- data/.rubocop.yml +3 -1
- data/README.adoc +39 -0
- data/grammars/basicdoc.rng +26 -7
- data/grammars/biblio.rng +3 -2
- data/grammars/csd.rng +3 -0
- data/grammars/isodoc.rng +686 -96
- data/grammars/reqt.rng +34 -5
- data/lib/relaton_calconnect/cc_bibliographic_item.rb +1 -1
- data/lib/relaton_calconnect/cc_bibliography.rb +6 -10
- data/lib/relaton_calconnect/data_fetcher.rb +93 -0
- data/lib/relaton_calconnect/hit_collection.rb +3 -3
- data/lib/relaton_calconnect/processor.rb +14 -1
- data/lib/relaton_calconnect/scrapper.rb +65 -10
- data/lib/relaton_calconnect/version.rb +1 -1
- data/lib/relaton_calconnect/xml_parser.rb +2 -2
- data/lib/relaton_calconnect.rb +1 -0
- data/relaton_calconnect.gemspec +3 -5
- metadata +8 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fc6f1d7dfe13d3c4db9b18e95dc9f5aed1bedefd19213c70dbd873de26a38ce2
|
4
|
+
data.tar.gz: bab5ad5fec02754e549f7a35f488a985d03947c5a428fe6b02438a2a1cc54d3f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 902f6d7353903a53cd1739d7a094c2be8d72fe94b73066bd849559463a368060d4692542cbc48c49764b128be44e3e83177e5d18c0e0ae8c88bbc491484f586b
|
7
|
+
data.tar.gz: ca2dcfca25d202703a3a32032880b82532e7c75a7395582bcbdac6314c71a92c0c5fe2bd5d8a62b737c20e6d51c2188d2f33970b833fb4368f99a2840371a038
|
data/.github/workflows/rake.yml
CHANGED
@@ -16,19 +16,9 @@ jobs:
|
|
16
16
|
strategy:
|
17
17
|
fail-fast: false
|
18
18
|
matrix:
|
19
|
-
ruby: [ '
|
19
|
+
ruby: [ '3.0', '2.7', '2.6', '2.5' ]
|
20
20
|
os: [ ubuntu-latest, windows-latest, macos-latest ]
|
21
21
|
experimental: [ false ]
|
22
|
-
include:
|
23
|
-
- ruby: '3.0'
|
24
|
-
os: 'ubuntu-latest'
|
25
|
-
experimental: true
|
26
|
-
- ruby: '3.0'
|
27
|
-
os: 'windows-latest'
|
28
|
-
experimental: true
|
29
|
-
- ruby: '3.0'
|
30
|
-
os: 'macos-latest'
|
31
|
-
experimental: true
|
32
22
|
steps:
|
33
23
|
- uses: actions/checkout@v2
|
34
24
|
with:
|
data/.rubocop.yml
CHANGED
@@ -2,9 +2,11 @@
|
|
2
2
|
# https://github.com/riboseinc/oss-guides
|
3
3
|
# All project-specific additions and overrides should be specified in this file.
|
4
4
|
|
5
|
+
require: rubocop-rails
|
6
|
+
|
5
7
|
inherit_from:
|
6
8
|
- https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
|
7
9
|
AllCops:
|
8
|
-
TargetRubyVersion: 2.
|
10
|
+
TargetRubyVersion: 2.5
|
9
11
|
Rails:
|
10
12
|
Enabled: false
|
data/README.adoc
CHANGED
@@ -76,6 +76,26 @@ item.to_xml bibdata: true
|
|
76
76
|
</bibdata>"
|
77
77
|
----
|
78
78
|
|
79
|
+
=== Typed links
|
80
|
+
|
81
|
+
Each Calconnect document has link types:
|
82
|
+
|
83
|
+
* `xml` - XML format
|
84
|
+
* `pdf` - PDF format
|
85
|
+
* `doc` - Microsoft Word document format
|
86
|
+
* `html` - HTML format
|
87
|
+
* `rxl` - RelatonXML format
|
88
|
+
|
89
|
+
[source,ruby]
|
90
|
+
----
|
91
|
+
item.link
|
92
|
+
=> [#<RelatonBib::TypedUri:0x00007ff2d4b009e0 @content=#<Addressable::URI:0x668 URI:https://standards.calconnect.org/csd/cc-10005.xml>, @type="xml">,
|
93
|
+
#<RelatonBib::TypedUri:0x00007ff2d4b00378 @content=#<Addressable::URI:0x67c URI:https://standards.calconnect.org/csd/cc-10005.pdf>, @type="pdf">,
|
94
|
+
#<RelatonBib::TypedUri:0x00007ff2d4b00058 @content=#<Addressable::URI:0x690 URI:https://standards.calconnect.org/csd/cc-10005.doc>, @type="doc">,
|
95
|
+
#<RelatonBib::TypedUri:0x00007ff2d4b23d28 @content=#<Addressable::URI:0x6a4 URI:https://standards.calconnect.org/csd/cc-10005.html>, @type="html">,
|
96
|
+
#<RelatonBib::TypedUri:0x00007ff2d4b23a08 @content=#<Addressable::URI:0x6b8 URI:https://standards.calconnect.org/csd/cc-10005.rxl>, @type="rxl">]
|
97
|
+
----
|
98
|
+
|
79
99
|
=== Get code, and year
|
80
100
|
[source,ruby]
|
81
101
|
----
|
@@ -106,6 +126,25 @@ RelatonCalconnect::CcBibliographicItem.from_hash hash
|
|
106
126
|
...
|
107
127
|
----
|
108
128
|
|
129
|
+
=== Fetch data
|
130
|
+
|
131
|
+
This gem uses the https://raw.githubusercontent.com/usnistgov/NIST-Tech-Pubs/nist-pages/xml/allrecords.xml dataset as one of data sources.
|
132
|
+
|
133
|
+
The method `RelatonCalconnect::DataFetcher.fetch(output: "data", format: "yaml")` fetches all the documents from the datast and save them to the `./data` folder in YAML format.
|
134
|
+
Arguments:
|
135
|
+
|
136
|
+
- `output` - folder to save documents (default './data').
|
137
|
+
- `format` - format in which the documents are saved. Possimle formats are: `yaml`, `xml` (default `yaml`).
|
138
|
+
|
139
|
+
[source,ruby]
|
140
|
+
----
|
141
|
+
RelatonCalconnect::DataFetcher.fetch
|
142
|
+
Started at: 2021-09-09 16:03:51 +0200
|
143
|
+
Stopped at: 2021-09-09 16:04:12 +0200
|
144
|
+
Done in: 20 sec.
|
145
|
+
=> nil
|
146
|
+
----
|
147
|
+
|
109
148
|
== Development
|
110
149
|
|
111
150
|
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.
|
data/grammars/basicdoc.rng
CHANGED
@@ -173,9 +173,11 @@
|
|
173
173
|
<data type="dateTime"/>
|
174
174
|
</attribute>
|
175
175
|
</optional>
|
176
|
-
<
|
177
|
-
<
|
178
|
-
|
176
|
+
<optional>
|
177
|
+
<attribute name="from">
|
178
|
+
<data type="IDREF"/>
|
179
|
+
</attribute>
|
180
|
+
</optional>
|
179
181
|
<optional>
|
180
182
|
<attribute name="to">
|
181
183
|
<data type="IDREF"/>
|
@@ -624,6 +626,9 @@
|
|
624
626
|
<choice>
|
625
627
|
<ref name="PureTextElement"/>
|
626
628
|
<ref name="stem"/>
|
629
|
+
<ref name="eref"/>
|
630
|
+
<ref name="xref"/>
|
631
|
+
<ref name="hyperlink"/>
|
627
632
|
</choice>
|
628
633
|
</zeroOrMore>
|
629
634
|
</element>
|
@@ -634,6 +639,9 @@
|
|
634
639
|
<choice>
|
635
640
|
<ref name="PureTextElement"/>
|
636
641
|
<ref name="stem"/>
|
642
|
+
<ref name="eref"/>
|
643
|
+
<ref name="xref"/>
|
644
|
+
<ref name="hyperlink"/>
|
637
645
|
</choice>
|
638
646
|
</zeroOrMore>
|
639
647
|
</element>
|
@@ -641,7 +649,12 @@
|
|
641
649
|
<define name="tt">
|
642
650
|
<element name="tt">
|
643
651
|
<zeroOrMore>
|
644
|
-
<
|
652
|
+
<choice>
|
653
|
+
<ref name="PureTextElement"/>
|
654
|
+
<ref name="eref"/>
|
655
|
+
<ref name="xref"/>
|
656
|
+
<ref name="hyperlink"/>
|
657
|
+
</choice>
|
645
658
|
</zeroOrMore>
|
646
659
|
</element>
|
647
660
|
</define>
|
@@ -822,7 +835,9 @@
|
|
822
835
|
<attribute name="alt"/>
|
823
836
|
</optional>
|
824
837
|
<ref name="CitationType"/>
|
825
|
-
<
|
838
|
+
<oneOrMore>
|
839
|
+
<ref name="PureTextElement"/>
|
840
|
+
</oneOrMore>
|
826
841
|
</define>
|
827
842
|
<define name="hyperlink">
|
828
843
|
<element name="link">
|
@@ -835,7 +850,9 @@
|
|
835
850
|
<optional>
|
836
851
|
<attribute name="alt"/>
|
837
852
|
</optional>
|
838
|
-
<
|
853
|
+
<oneOrMore>
|
854
|
+
<ref name="PureTextElement"/>
|
855
|
+
</oneOrMore>
|
839
856
|
</element>
|
840
857
|
</define>
|
841
858
|
<define name="xref">
|
@@ -849,7 +866,9 @@
|
|
849
866
|
<optional>
|
850
867
|
<attribute name="alt"/>
|
851
868
|
</optional>
|
852
|
-
<
|
869
|
+
<oneOrMore>
|
870
|
+
<ref name="PureTextElement"/>
|
871
|
+
</oneOrMore>
|
853
872
|
</element>
|
854
873
|
</define>
|
855
874
|
<define name="fn">
|
data/grammars/biblio.rng
CHANGED
@@ -401,9 +401,9 @@
|
|
401
401
|
<choice>
|
402
402
|
<!-- iso191606 TODO -->
|
403
403
|
<group>
|
404
|
-
<
|
404
|
+
<zeroOrMore>
|
405
405
|
<ref name="street"/>
|
406
|
-
</
|
406
|
+
</zeroOrMore>
|
407
407
|
<ref name="city"/>
|
408
408
|
<optional>
|
409
409
|
<ref name="state"/>
|
@@ -787,6 +787,7 @@
|
|
787
787
|
<value>adapted</value>
|
788
788
|
<value>vote-started</value>
|
789
789
|
<value>vote-ended</value>
|
790
|
+
<value>announced</value>
|
790
791
|
</choice>
|
791
792
|
</define>
|
792
793
|
<define name="bdate">
|