relaton-cie 1.20.1 → 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/.rubocop.yml +1 -1
- data/README.adoc +36 -27
- data/bin/console +1 -1
- data/grammars/basicdoc.rng +1559 -671
- data/grammars/biblio-standoc.rng +107 -46
- data/grammars/biblio.rng +1000 -375
- data/lib/relaton/cie/bibdata.rb +7 -0
- data/lib/relaton/cie/bibitem.rb +7 -0
- data/lib/relaton/cie/bibliography.rb +31 -0
- data/lib/relaton/cie/data_fetcher.rb +257 -0
- data/lib/relaton/cie/ext.rb +11 -0
- data/lib/relaton/cie/item.rb +11 -0
- data/lib/relaton/cie/item_data.rb +6 -0
- data/lib/relaton/cie/processor.rb +66 -0
- data/lib/relaton/cie/scrapper.rb +39 -0
- data/lib/relaton/cie/util.rb +8 -0
- data/lib/relaton/cie/version.rb +5 -0
- data/lib/relaton/cie.rb +28 -0
- data/relaton_cie.gemspec +7 -6
- metadata +34 -22
- data/lib/relaton_cie/bibliographic_item.rb +0 -7
- data/lib/relaton_cie/cie_bibliography.rb +0 -29
- data/lib/relaton_cie/data_fetcher.rb +0 -252
- data/lib/relaton_cie/hash_converter.rb +0 -11
- data/lib/relaton_cie/name_parser.rb +0 -6
- data/lib/relaton_cie/processor.rb +0 -58
- data/lib/relaton_cie/scrapper.rb +0 -41
- data/lib/relaton_cie/util.rb +0 -6
- data/lib/relaton_cie/version.rb +0 -3
- data/lib/relaton_cie/xml_parser.rb +0 -13
- data/lib/relaton_cie.rb +0 -25
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5a41c3c7829bf05dc593f3d7217281bcd5f28c385794513a1dcad500e6d605c8
|
|
4
|
+
data.tar.gz: d2f9c4f0e50285409dfdd43605b6af40b47f398dab95de8902ac8745ac98760f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 56120f73fc6ae1d3f528b05535e9d325cbf171a6ae611c54f1a513663adfb277b0c4b87123b97a8d169da1d11b81eedb41cb141e39cce74285a729b6e281b025
|
|
7
|
+
data.tar.gz: 1b58cb14fd99c03c270a658280c23689ee10bb811580fb463c0adeeea88b07a4d8a8a7299975bcc26dde43d0f82b790e76843a14707c9f2cd475d075f72b2a48
|
data/.rubocop.yml
CHANGED
data/README.adoc
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
=
|
|
1
|
+
= Relaton::Cie
|
|
2
2
|
|
|
3
3
|
image:https://img.shields.io/gem/v/relaton-cie.svg["Gem Version", link="https://rubygems.org/gems/relaton-cie"]
|
|
4
4
|
image:https://github.com/relaton/relaton-cie/workflows/macos/badge.svg["Build Status (macOS)", link="https://github.com/relaton/relaton-cie/actions?workflow=macos"]
|
|
@@ -33,19 +33,19 @@ Or install it yourself as:
|
|
|
33
33
|
|
|
34
34
|
[source,ruby]
|
|
35
35
|
----
|
|
36
|
-
require '
|
|
36
|
+
require 'relaton/cie'
|
|
37
37
|
=> true
|
|
38
38
|
|
|
39
|
-
item =
|
|
40
|
-
[relaton-cie] (CIE 001-1980) Fetching from
|
|
41
|
-
[relaton-cie] (CIE 001-1980) Found: `CIE 001-1980`
|
|
42
|
-
=> #<
|
|
39
|
+
item = Relaton::Cie::Bibliography.get 'CIE 001-1980'
|
|
40
|
+
[relaton-cie] INFO: (CIE 001-1980) Fetching from Relaton repository ...
|
|
41
|
+
[relaton-cie] INFO: (CIE 001-1980) Found: `CIE 001-1980`
|
|
42
|
+
=> #<Relaton::Bib::ItemData:0x0000000123b05300
|
|
43
43
|
...
|
|
44
44
|
|
|
45
45
|
# Return nil if a document doesn't exist.
|
|
46
|
-
|
|
47
|
-
[relaton-cie] (1111) Fetching from
|
|
48
|
-
[relaton-cie] (1111) Not found.
|
|
46
|
+
Relaton::Cie::Bibliography.get '1111'
|
|
47
|
+
[relaton-cie] INFO: (1111) Fetching from Relaton repository ...
|
|
48
|
+
[relaton-cie] INFO: (1111) Not found.
|
|
49
49
|
=> nil
|
|
50
50
|
----
|
|
51
51
|
|
|
@@ -54,11 +54,11 @@ RelatonCie::CieBibliography.get '1111'
|
|
|
54
54
|
[source,ruby]
|
|
55
55
|
----
|
|
56
56
|
item.to_xml
|
|
57
|
-
=> "<bibitem id="
|
|
58
|
-
<fetched>
|
|
59
|
-
<title type="title-main"
|
|
60
|
-
<title type="main"
|
|
61
|
-
<uri type="src">https://
|
|
57
|
+
=> "<bibitem id="CIE0011980" type="standard" schema-version="v1.4.1">
|
|
58
|
+
<fetched>2025-12-23</fetched>
|
|
59
|
+
<title type="title-main">Guidelines for minimizing urban sky glow near astronomical observatories (Joint Publication IAU/CIE)</title>
|
|
60
|
+
<title type="main">Guidelines for minimizing urban sky glow near astronomical observatories (Joint Publication IAU/CIE)</title>
|
|
61
|
+
<uri type="src">https://store.accuristech.com/standards/cie-001-1980?product_id=1210107</uri>
|
|
62
62
|
...
|
|
63
63
|
</bibitem>"
|
|
64
64
|
----
|
|
@@ -67,33 +67,39 @@ With `bibdata: true` option XML output is wrapped with `bibdata` element and `ex
|
|
|
67
67
|
[source,ruby]
|
|
68
68
|
----
|
|
69
69
|
item.to_xml bibdata: true
|
|
70
|
-
=> "<bibdata type="standard" schema-version="v1.
|
|
71
|
-
<fetched>
|
|
72
|
-
<title type="title-main"
|
|
73
|
-
<title type="main"
|
|
74
|
-
<uri type="src">https://
|
|
70
|
+
=> "<bibdata type="standard" schema-version="v1.4.1">
|
|
71
|
+
<fetched>2025-12-23</fetched>
|
|
72
|
+
<title type="title-main">Guidelines for minimizing urban sky glow near astronomical observatories (Joint Publication IAU/CIE)</title>
|
|
73
|
+
<title type="main">Guidelines for minimizing urban sky glow near astronomical observatories (Joint Publication IAU/CIE)</title>
|
|
74
|
+
<uri type="src">https://store.accuristech.com/standards/cie-001-1980?product_id=1210107</uri>
|
|
75
75
|
...
|
|
76
76
|
<ext schema-version="v1.0.0">
|
|
77
77
|
<doctype>document</doctype>
|
|
78
|
+
<flavor>cie</flavor>
|
|
78
79
|
</ext>
|
|
79
|
-
</bibdata>
|
|
80
|
+
</bibdata>
|
|
80
81
|
----
|
|
81
82
|
=== Typed links
|
|
82
83
|
|
|
83
|
-
Each CIE document has `src` type link.
|
|
84
|
+
Each CIE document has `src` type source link.
|
|
84
85
|
|
|
85
86
|
[source,ruby]
|
|
86
87
|
----
|
|
87
|
-
item.
|
|
88
|
-
=> [#<
|
|
88
|
+
item.source
|
|
89
|
+
=> [#<Relaton::Bib::Uri:0x0000000123cc2990
|
|
90
|
+
@content="https://store.accuristech.com/standards/cie-001-1980?product_id=1210107",
|
|
91
|
+
@language=nil,
|
|
92
|
+
@locale=nil,
|
|
93
|
+
@script=nil,
|
|
94
|
+
@type="src">]
|
|
89
95
|
----
|
|
90
96
|
|
|
91
97
|
=== Parse a file locally
|
|
92
98
|
|
|
93
99
|
[source,ruby]
|
|
94
100
|
----
|
|
95
|
-
item =
|
|
96
|
-
#<
|
|
101
|
+
item = Relaton::Cie::Item.from_xml File.read("spec/fixtures/bibdata.xml")
|
|
102
|
+
=> #<Relaton::Cie::ItemData:0x000000010d00d0d0
|
|
97
103
|
...
|
|
98
104
|
----
|
|
99
105
|
|
|
@@ -101,7 +107,7 @@ item = RelatonCie::XMLParser.from_xml File.read("spec/fixtures/bibdata.xml")
|
|
|
101
107
|
|
|
102
108
|
This gem uses the https://www.techstreet.com/cie/searches/31156444 dataset as one of the data sources.
|
|
103
109
|
|
|
104
|
-
The method `
|
|
110
|
+
The method `Relaton::Cie::DataFetcher.fetch(output: "data", format: "yaml")` fetches all the documents from the dataset and saves them to the `./data` folder in YAML format.
|
|
105
111
|
Arguments:
|
|
106
112
|
|
|
107
113
|
- `output` - folder to save documents (default './data').
|
|
@@ -109,7 +115,10 @@ Arguments:
|
|
|
109
115
|
|
|
110
116
|
[source,ruby]
|
|
111
117
|
----
|
|
112
|
-
|
|
118
|
+
require "relaton/cie/data_fetcher"
|
|
119
|
+
=> true
|
|
120
|
+
|
|
121
|
+
Relaton::Cie::DataFetcher.fetch
|
|
113
122
|
Started at: 2021-09-08 16:37:53 +0200
|
|
114
123
|
Stopped at: 2021-09-08 16:49:17 +0200
|
|
115
124
|
Done in: 684 sec.
|
data/bin/console
CHANGED