relaton-ccsds 1.20.3 → 2.0.0.pre.alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.rubocop.yml +1 -1
- data/Gemfile +1 -0
- data/README.adoc +50 -84
- data/ccsdsallpubs.html +3408 -0
- data/grammars/basicdoc.rng +1559 -671
- data/grammars/biblio-standoc.rng +107 -46
- data/grammars/biblio.rng +1010 -375
- data/grammars/relaton-ccsds-compile.rng +11 -0
- data/grammars/relaton-ccsds.rng +44 -0
- data/lib/relaton/ccsds/bibliography.rb +63 -0
- data/lib/relaton/ccsds/data/fetcher.rb +238 -0
- data/lib/relaton/ccsds/data/iso_references.rb +30 -0
- data/lib/relaton/ccsds/data/parser.rb +194 -0
- data/lib/relaton/ccsds/hit.rb +24 -0
- data/lib/relaton/ccsds/hit_collection.rb +40 -0
- data/lib/relaton/ccsds/item_data.rb +9 -0
- data/lib/relaton/ccsds/model/bibdata.rb +7 -0
- data/lib/relaton/ccsds/model/bibitem.rb +7 -0
- data/lib/relaton/ccsds/model/doctype.rb +9 -0
- data/lib/relaton/ccsds/model/ext.rb +19 -0
- data/lib/relaton/ccsds/model/item.rb +13 -0
- data/lib/relaton/ccsds/processor.rb +68 -0
- data/lib/relaton/ccsds/util.rb +10 -0
- data/lib/relaton/ccsds/version.rb +5 -0
- data/lib/relaton/ccsds.rb +30 -0
- data/relaton_ccsds.gemspec +11 -8
- metadata +73 -28
- data/lib/relaton_ccsds/bibliographic_item.rb +0 -56
- data/lib/relaton_ccsds/bibliography.rb +0 -41
- data/lib/relaton_ccsds/data_fetcher.rb +0 -278
- data/lib/relaton_ccsds/data_parser.rb +0 -145
- data/lib/relaton_ccsds/document_type.rb +0 -16
- data/lib/relaton_ccsds/hash_converter.rb +0 -25
- data/lib/relaton_ccsds/hit.rb +0 -21
- data/lib/relaton_ccsds/hit_collection.rb +0 -29
- data/lib/relaton_ccsds/processor.rb +0 -60
- data/lib/relaton_ccsds/util.rb +0 -6
- data/lib/relaton_ccsds/version.rb +0 -5
- data/lib/relaton_ccsds/xml_parser.rb +0 -35
- data/lib/relaton_ccsds.rb +0 -29
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7c106ed2fbc3608d8f3bb9c611fb9096d05240cb5bd8a92ef214f1c37a609786
|
|
4
|
+
data.tar.gz: 0ab13877e70880ba30d40ace2b8a9d64c834edb1d7da85d47c52af84fb4d4f75
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 475da2289b16e93e4001ed60d817897c73a3b67c91c31bf565c5dcfddffe0727a82d2c4ddc722782f9b7fcda5406fd6065df444da0a71f8d3dde893d6b95f294
|
|
7
|
+
data.tar.gz: 4c953914d7842c9cfc2381d3c56ef463ac0e445ca649ef9702dda297e74ea2be76be5aae59d123255d583b7e5f7b9712bc2167605090d6f6cb8c72b523d268ac
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
data/Gemfile
CHANGED
data/README.adoc
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
=
|
|
1
|
+
= Relaton::Ccsds
|
|
2
2
|
|
|
3
3
|
RelatonCcsds is a Ruby gem that implements the https://github.com/relaton/relaton-models#bibliographic-item[BibliographicItem model].
|
|
4
4
|
|
|
@@ -27,14 +27,23 @@ Or install it yourself as:
|
|
|
27
27
|
|
|
28
28
|
[source,ruby]
|
|
29
29
|
----
|
|
30
|
-
require '
|
|
30
|
+
require 'relaton/ccsds'
|
|
31
31
|
=> true
|
|
32
32
|
|
|
33
|
-
hits =
|
|
34
|
-
=> <
|
|
33
|
+
hits = Relaton::Ccsds::Bibliography.search("CCSDS 230.2-G-1")
|
|
34
|
+
=> <Relaton::Ccsds::HitCollection:0x000000000016b0 @ref=CCSDS 230.2-G-1 @fetched=false>
|
|
35
35
|
|
|
36
|
-
item = hits[0].
|
|
37
|
-
=> #<
|
|
36
|
+
item = hits[0].item
|
|
37
|
+
=> #<Relaton::Ccsds::ItemData:0x0000000125ae1318
|
|
38
|
+
...
|
|
39
|
+
|
|
40
|
+
item.docidentifier[0].content
|
|
41
|
+
=> "CCSDS 230.2-G-1"
|
|
42
|
+
|
|
43
|
+
item = Relaton::Ccsds::Bibliography.get("CCSDS 230.2-G-1")
|
|
44
|
+
[relaton-ccsds] INFO: (CCSDS 230.2-G-1) Fetching from Relaton repository ...
|
|
45
|
+
[relaton-ccsds] INFO: (CCSDS 230.2-G-1) Found: `CCSDS 230.2-G-1`.
|
|
46
|
+
=> #<Relaton::Ccsds::ItemData:0x0000000125deba40
|
|
38
47
|
...
|
|
39
48
|
----
|
|
40
49
|
|
|
@@ -43,10 +52,11 @@ item = hits[0].doc
|
|
|
43
52
|
[source,ruby]
|
|
44
53
|
----
|
|
45
54
|
item.to_xml
|
|
46
|
-
=> "<bibitem id="
|
|
47
|
-
<fetched>
|
|
48
|
-
<title
|
|
49
|
-
<uri type="
|
|
55
|
+
=> "<bibitem id="CCSDS2302G1" schema-version="v1.4.1">
|
|
56
|
+
<fetched>2025-12-03</fetched>
|
|
57
|
+
<title language="en" script="Latn">Next Generation Uplink</title>
|
|
58
|
+
<uri type="src">https://ccsds.org/publications/ccsdsallpubs/entry/3224/</uri>
|
|
59
|
+
<uri type="pdf">https://ccsds.org/wp-content/uploads/gravity_forms/5-448e85c647331d9cbaf66c096458bdd5/2025/01//230x2g1.pdf</uri>
|
|
50
60
|
<docidentifier type="CCSDS" primary="true">CCSDS 230.2-G-1</docidentifier>
|
|
51
61
|
...
|
|
52
62
|
</bibitem>"
|
|
@@ -55,16 +65,13 @@ With argument `bibdata: true` it outputs XML wrapped by `bibdata` element and ad
|
|
|
55
65
|
[source,ruby]
|
|
56
66
|
----
|
|
57
67
|
item.to_xml bibdata: true
|
|
58
|
-
=> "<bibdata schema-version="v1.
|
|
59
|
-
<fetched>
|
|
60
|
-
<title
|
|
61
|
-
<uri type="
|
|
68
|
+
=> "<bibdata schema-version="v1.4.1">
|
|
69
|
+
<fetched>2025-12-03</fetched>
|
|
70
|
+
<title language="en" script="Latn">Next Generation Uplink</title>
|
|
71
|
+
<uri type="src">https://ccsds.org/publications/ccsdsallpubs/entry/3224/</uri>
|
|
62
72
|
...
|
|
63
73
|
<ext>
|
|
64
74
|
<doctype>report</doctype>
|
|
65
|
-
<editorialgroup>
|
|
66
|
-
<technical-committee>SLS-NGU</technical-committee>
|
|
67
|
-
</editorialgroup>
|
|
68
75
|
<technology-area>Space Link Services Area</technology-area>
|
|
69
76
|
</ext>
|
|
70
77
|
</bibdata>"
|
|
@@ -76,99 +83,57 @@ All the CCSDS documents have PDF links. Some of them have additional DOC links.
|
|
|
76
83
|
|
|
77
84
|
[source,ruby]
|
|
78
85
|
----
|
|
79
|
-
item.
|
|
80
|
-
=> [#<
|
|
81
|
-
|
|
86
|
+
item.source
|
|
87
|
+
=> [#<Relaton::Bib::Uri:0x0000000126722b90 @content="https://ccsds.org/publications/ccsdsallpubs/entry/3224/", @language=nil, @locale=nil, @script=nil, @type="src">,
|
|
88
|
+
#<Relaton::Bib::Uri:0x0000000126722690
|
|
89
|
+
@content="https://ccsds.org/wp-content/uploads/gravity_forms/5-448e85c647331d9cbaf66c096458bdd5/2025/01//230x2g1.pdf",
|
|
82
90
|
@language=nil,
|
|
91
|
+
@locale=nil,
|
|
83
92
|
@script=nil,
|
|
84
93
|
@type="pdf">]
|
|
85
94
|
|
|
86
|
-
|
|
95
|
+
Relaton::Ccsds::Bibliography.get("CCSDS 720.6-Y-1").source
|
|
87
96
|
[relaton-ccsds] (CCSDS 720.6-Y-1) Fetching from Relaton repository ...
|
|
88
97
|
[relaton-ccsds] (CCSDS 720.6-Y-1) Found: `CCSDS 720.6-Y-1`.
|
|
89
|
-
=> [#<
|
|
90
|
-
|
|
98
|
+
=> [#<Relaton::Bib::Uri:0x00000001268cfba0 @content="https://ccsds.org/publications/ccsdsallpubs/entry/3160/", @language=nil, @locale=nil, @script=nil, @type="src">,
|
|
99
|
+
#<Relaton::Bib::Uri:0x00000001268cf650
|
|
100
|
+
@content="https://ccsds.org/wp-content/uploads/gravity_forms/5-448e85c647331d9cbaf66c096458bdd5/2025/01//720x6y1.doc",
|
|
91
101
|
@language=nil,
|
|
102
|
+
@locale=nil,
|
|
92
103
|
@script=nil,
|
|
93
|
-
@type="
|
|
94
|
-
#<
|
|
95
|
-
@content
|
|
104
|
+
@type="doc">,
|
|
105
|
+
#<Relaton::Bib::Uri:0x00000001268cf100
|
|
106
|
+
@content="https://ccsds.org/wp-content/uploads/gravity_forms/5-448e85c647331d9cbaf66c096458bdd5/2025/01//720x6y1.pdf",
|
|
96
107
|
@language=nil,
|
|
108
|
+
@locale=nil,
|
|
97
109
|
@script=nil,
|
|
98
|
-
@type="
|
|
99
|
-
----
|
|
100
|
-
|
|
101
|
-
=== Get document by code and year
|
|
102
|
-
[source,ruby]
|
|
103
|
-
----
|
|
104
|
-
RelatonCcsds::Bibliography.get("CCSDS 230.2-G-1")
|
|
105
|
-
[relaton-ccsds] (CCSDS 230.2-G-1) Fetching from Relaton repository ...
|
|
106
|
-
[relaton-ccsds] (CCSDS 230.2-G-1) Found: `CCSDS 230.2-G-1`.
|
|
107
|
-
=> #<RelatonCcsds::BibliographicItem:0x00000001135dade0
|
|
108
|
-
...
|
|
109
|
-
----
|
|
110
|
-
|
|
111
|
-
=== Get specific format
|
|
112
|
-
|
|
113
|
-
[source,ruby]
|
|
114
|
-
----
|
|
115
|
-
item = RelatonCcsds::Bibliography.get("CCSDS 720.4-Y-1 (DOC)")
|
|
116
|
-
[relaton-ccsds] (CCSDS 720.4-Y-1 (DOC)) Fetching from Relaton repository ...
|
|
117
|
-
[relaton-ccsds] (CCSDS 720.4-Y-1 (DOC)) Found: `CCSDS 720.4-Y-1`.
|
|
118
|
-
=> #<RelatonCcsds::BibliographicItem:0x000000011100dfe0
|
|
119
|
-
...
|
|
120
|
-
|
|
121
|
-
item.link.size
|
|
122
|
-
=> 1
|
|
123
|
-
|
|
124
|
-
item.link[0].type
|
|
125
|
-
=> "doc"
|
|
126
|
-
|
|
127
|
-
pry(main)> item.link[0].content.to_s
|
|
128
|
-
=> "https://public.ccsds.org/Pubs/720x4y1.doc"
|
|
129
|
-
|
|
130
|
-
item = RelatonCcsds::Bibliography.get("CCSDS 720.4-Y-1 (PDF)")
|
|
131
|
-
[relaton-ccsds] (CCSDS 720.4-Y-1 (PDF)) Fetching from Relaton repository ...
|
|
132
|
-
[relaton-ccsds] (CCSDS 720.4-Y-1 (PDF)) Found: `CCSDS 720.4-Y-1`.
|
|
133
|
-
=> #<RelatonCcsds::BibliographicItem:0x0000000111004620
|
|
134
|
-
...
|
|
135
|
-
|
|
136
|
-
item.link.size
|
|
137
|
-
=> 1
|
|
138
|
-
|
|
139
|
-
item.link[0].type
|
|
140
|
-
=> "pdf"
|
|
141
|
-
|
|
142
|
-
item.link[0].content.to_s
|
|
143
|
-
=> "https://public.ccsds.org/Pubs/720x4y1.pdf"
|
|
110
|
+
@type="pdf">]
|
|
144
111
|
----
|
|
145
112
|
|
|
146
113
|
=== Create bibliographic item from XML
|
|
147
114
|
[source,ruby]
|
|
148
115
|
----
|
|
149
|
-
|
|
150
|
-
=> #<
|
|
116
|
+
Relaton::Ccsds::Item.from_xml File.read('spec/fixtures/ccsds_230_2-g-1.xml')
|
|
117
|
+
=> #<Relaton::Ccsds::ItemData:0x0000000127b46680
|
|
151
118
|
...
|
|
152
119
|
----
|
|
153
120
|
|
|
154
121
|
=== Create bibliographic item from YAML
|
|
155
122
|
[source,ruby]
|
|
156
123
|
----
|
|
157
|
-
|
|
158
|
-
=>
|
|
159
|
-
"id"=>"CCSDS230.2-G-1",
|
|
160
|
-
...
|
|
124
|
+
yaml = File.read 'spec/fixtures/ccsds_230_2-g-1.yaml'
|
|
125
|
+
=> ---\nschema-version: v1.2.9\nid: CCSDS230.2-G-1 ...
|
|
161
126
|
|
|
162
|
-
|
|
163
|
-
=> #<
|
|
127
|
+
Relaton::Ccsds::Item.from_yaml yaml
|
|
128
|
+
=> #<Relaton::Ccsds::ItemData:0x0000000122e4caa0
|
|
164
129
|
...
|
|
165
130
|
----
|
|
166
131
|
|
|
167
132
|
=== Fetch data
|
|
168
133
|
|
|
169
|
-
This gem uses the https://
|
|
134
|
+
This gem uses the https://ccsds.org/publications/ccsdsallpubs/ page as a data source.
|
|
170
135
|
|
|
171
|
-
The method `
|
|
136
|
+
The method `Relaton::Ccsds::DataFetcher.fetch(output: "data", format: "yaml")` fetches all the documents from the data source and saves them to the `./data` folder in YAML format.
|
|
172
137
|
Arguments:
|
|
173
138
|
|
|
174
139
|
- `output` - folder to save documents (default './data').
|
|
@@ -176,11 +141,12 @@ Arguments:
|
|
|
176
141
|
|
|
177
142
|
[source,ruby]
|
|
178
143
|
----
|
|
179
|
-
|
|
144
|
+
require 'relaton/ccsds/data/fetcher'
|
|
145
|
+
Relaton::Ccsds::DataFetcher.fetch
|
|
180
146
|
Started at: 2023-08-25 22:02:06 -0400
|
|
181
147
|
(data/CCSDS-720-4-Y-1.yaml) file already exists. Trying to merge links ...
|
|
182
148
|
...
|
|
183
|
-
Done in:
|
|
149
|
+
Done in: 40 sec.
|
|
184
150
|
=> nil
|
|
185
151
|
----
|
|
186
152
|
|