relaton-ecma 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 +62 -55
- data/grammars/basicdoc.rng +1559 -671
- data/grammars/biblio-standoc.rng +107 -46
- data/grammars/biblio.rng +1010 -375
- data/lib/relaton/ecma/bibdata.rb +7 -0
- data/lib/relaton/ecma/bibitem.rb +7 -0
- data/lib/relaton/ecma/bibliography.rb +79 -0
- data/lib/relaton/ecma/data_fetcher.rb +93 -0
- data/lib/relaton/ecma/data_parser.rb +235 -0
- data/lib/relaton/ecma/ext.rb +11 -0
- data/lib/relaton/ecma/item.rb +11 -0
- data/lib/relaton/ecma/item_data.rb +6 -0
- data/lib/relaton/ecma/processor.rb +65 -0
- data/lib/relaton/ecma/util.rb +8 -0
- data/lib/relaton/ecma/version.rb +5 -0
- data/lib/relaton/ecma.rb +24 -0
- data/relaton_ecma.gemspec +7 -6
- metadata +34 -21
- data/lib/relaton_ecma/bibliographic_item.rb +0 -12
- data/lib/relaton_ecma/data_fetcher.rb +0 -96
- data/lib/relaton_ecma/data_parser.rb +0 -221
- data/lib/relaton_ecma/ecma_bibliography.rb +0 -79
- data/lib/relaton_ecma/hash_converter.rb +0 -12
- data/lib/relaton_ecma/processor.rb +0 -58
- data/lib/relaton_ecma/util.rb +0 -6
- data/lib/relaton_ecma/version.rb +0 -3
- data/lib/relaton_ecma/xml_parser.rb +0 -13
- data/lib/relaton_ecma.rb +0 -24
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 25227ecdc3934df69612a531212d0646ee08dd246194f796d6f5bd54fd87b7f6
|
|
4
|
+
data.tar.gz: f2e36a4f3f59ca632fb35718bc75c7fa2470d86e7e234be4c93dd28a4b17fd5a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 49352ae2b3f43fcbcb8dc83da685198d2eeb6845b985c0f2148ffa2e2459df8e9a5e042bf003418fc942243cbef3311e1a240986a48c055dc451ae11b24748e0
|
|
7
|
+
data.tar.gz: 409281a068a0f1e7fec12ab54a8ad865e468be0e55b2d65028ebeeb4da09d96e606888b14133e00f8afbe7b6cf81d728a1cce2a642501a4f40da7f16d5f50157
|
data/.rubocop.yml
CHANGED
data/README.adoc
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
=
|
|
1
|
+
= Relaton::Ecma
|
|
2
2
|
|
|
3
3
|
image:https://img.shields.io/gem/v/relaton-ecma.svg["Gem Version", link="https://rubygems.org/gems/relaton-ecma"]
|
|
4
4
|
image:https://github.com/relaton/relaton-ecma/workflows/macos/badge.svg["Build Status (macOS)", link="https://github.com/relaton/relaton-ecma/actions?workflow=macos"]
|
|
@@ -8,7 +8,7 @@ image:https://codeclimate.com/github/relaton/relaton-ecma/badges/gpa.svg["Code C
|
|
|
8
8
|
image:https://img.shields.io/github/issues-pr-raw/relaton/relaton-ecma.svg["Pull Requests", link="https://github.com/relaton/relaton-ecma/pulls"]
|
|
9
9
|
image:https://img.shields.io/github/commits-since/relaton/relaton-ecma/latest.svg["Commits since latest",link="https://github.com/relaton/relaton-ecma/releases"]
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Relaton::Ecma is a Ruby gem that searches and fetches standards from the https://www.ecma-international.org[European Computer Manufacturers Association].
|
|
12
12
|
|
|
13
13
|
== Installation
|
|
14
14
|
|
|
@@ -45,61 +45,61 @@ ECMA mementos have the following reference structure: `ECMA MEM/{YEAR}`. Where:
|
|
|
45
45
|
|
|
46
46
|
[source,ruby]
|
|
47
47
|
----
|
|
48
|
-
require '
|
|
48
|
+
require 'relaton/ecma'
|
|
49
49
|
=> true
|
|
50
50
|
|
|
51
51
|
# fetch ECMA standard
|
|
52
|
-
item =
|
|
53
|
-
[relaton-ecma] (ECMA-6) Fetching from Relaton repository ...
|
|
54
|
-
[relaton-ecma] (ECMA-6) Found: `ECMA-6`
|
|
55
|
-
#<
|
|
52
|
+
item = Relaton::Ecma::Bibliography.get 'ECMA-6'
|
|
53
|
+
[relaton-ecma] INFO: (ECMA-6) Fetching from Relaton repository ...
|
|
54
|
+
[relaton-ecma] INFO: (ECMA-6) Found: `ECMA-6`
|
|
55
|
+
=> #<Relaton::Ecma::ItemData:0x000000012791d7a0
|
|
56
56
|
...
|
|
57
57
|
|
|
58
58
|
# fetch ECMA standard with edition and volume
|
|
59
|
-
|
|
60
|
-
[relaton-ecma] (ECMA-269 ed3 vol2) Fetching from Relaton repository ...
|
|
61
|
-
[relaton-ecma] (ECMA-269 ed3 vol2) Found: `ECMA-269`
|
|
62
|
-
=> #<
|
|
59
|
+
Relaton::Ecma::Bibliography.get "ECMA-269 ed3 vol2"
|
|
60
|
+
[relaton-ecma] INFO: (ECMA-269 ed3 vol2) Fetching from Relaton repository ...
|
|
61
|
+
[relaton-ecma] INFO: (ECMA-269 ed3 vol2) Found: `ECMA-269`
|
|
62
|
+
=> #<Relaton::Ecma::ItemData:0x0000000127b81410
|
|
63
63
|
...
|
|
64
64
|
|
|
65
65
|
# fetch the last edition of ECMA standard
|
|
66
|
-
bib =
|
|
67
|
-
[relaton-ecma] (ECMA-269) Fetching from Relaton repository ...
|
|
68
|
-
[relaton-ecma] (ECMA-269) Found: `ECMA-269`
|
|
69
|
-
=> #<
|
|
66
|
+
bib = Relaton::Ecma::Bibliography.get "ECMA-269"
|
|
67
|
+
[relaton-ecma] INFO: (ECMA-269) Fetching from Relaton repository ...
|
|
68
|
+
[relaton-ecma] INFO: (ECMA-269) Found: `ECMA-269`
|
|
69
|
+
=> #<Relaton::Ecma::ItemData:0x0000000127cd0a00
|
|
70
70
|
...
|
|
71
71
|
|
|
72
72
|
bib.edition.content
|
|
73
73
|
=> "9"
|
|
74
74
|
|
|
75
75
|
# fetch the first volume of ECMA standard
|
|
76
|
-
bib =
|
|
77
|
-
[relaton-ecma] (ECMA-269 ed3) Fetching from Relaton repository ...
|
|
78
|
-
[relaton-ecma] (ECMA-269 ed3) Found: `ECMA-269`
|
|
79
|
-
=> #<
|
|
76
|
+
bib = Relaton::Ecma::Bibliography.get "ECMA-269 ed3"
|
|
77
|
+
[relaton-ecma] INFO: (ECMA-269 ed3) Fetching from Relaton repository ...
|
|
78
|
+
[relaton-ecma] INFO: (ECMA-269 ed3) Found: `ECMA-269`
|
|
79
|
+
=> #<Relaton::Ecma::ItemData:0x0000000127cf7808
|
|
80
80
|
...
|
|
81
81
|
|
|
82
|
-
bib.extent.first.reference_from
|
|
82
|
+
bib.extent.first.locality.first.reference_from
|
|
83
83
|
=> "1"
|
|
84
84
|
|
|
85
85
|
# fetch ECMA technical report
|
|
86
|
-
|
|
87
|
-
[relaton-ecma] (ECMA TR/18) Fetching from Relaton repository ...
|
|
88
|
-
[relaton-ecma] (ECMA TR/18) Found: `ECMA TR/18`
|
|
89
|
-
=> #<
|
|
86
|
+
Relaton::Ecma::Bibliography.get 'ECMA TR/18'
|
|
87
|
+
[relaton-ecma] INFO: (ECMA TR/18) Fetching from Relaton repository ...
|
|
88
|
+
[relaton-ecma] INFO: (ECMA TR/18) Found: `ECMA TR/18`
|
|
89
|
+
=> #<Relaton::Ecma::ItemData:0x0000000127cdc940
|
|
90
90
|
...
|
|
91
91
|
|
|
92
92
|
# fetch ECMA memento
|
|
93
|
-
|
|
94
|
-
[relaton-ecma] (ECMA MEM/2021) Fetching from Relaton repository ...
|
|
95
|
-
[relaton-ecma] (ECMA MEM/2021) Found: `ECMA MEM/2021`
|
|
96
|
-
=> #<
|
|
93
|
+
Relaton::Ecma::Bibliography.get "ECMA MEM/2021"
|
|
94
|
+
[relaton-ecma] INFO: (ECMA MEM/2021) Fetching from Relaton repository ...
|
|
95
|
+
[relaton-ecma] INFO: (ECMA MEM/2021) Found: `ECMA MEM/2021`
|
|
96
|
+
=> #<Relaton::Ecma::ItemData:0x0000000127cf71c8
|
|
97
97
|
...
|
|
98
98
|
|
|
99
99
|
# Return nil if a document doesn't exist.
|
|
100
|
-
|
|
101
|
-
[relaton-ecma] (1111) Fetching from Relaton repository ...
|
|
102
|
-
[relaton-ecma] (1111) Not found.
|
|
100
|
+
Relaton::Ecma::Bibliography.get '1111'
|
|
101
|
+
[relaton-ecma] INFO: (1111) Fetching from Relaton repository ...
|
|
102
|
+
[relaton-ecma] INFO: (1111) Not found.
|
|
103
103
|
=> nil
|
|
104
104
|
----
|
|
105
105
|
|
|
@@ -108,11 +108,11 @@ RelatonEcma::EcmaBibliography.get '1111'
|
|
|
108
108
|
[source,ruby]
|
|
109
109
|
----
|
|
110
110
|
item.to_xml
|
|
111
|
-
=> "<bibitem id="
|
|
112
|
-
<fetched>
|
|
113
|
-
<title
|
|
114
|
-
<uri type="src">https://
|
|
115
|
-
<uri type="
|
|
111
|
+
=> "<bibitem id="ECMA6" type="standard" schema-version="v1.4.1">
|
|
112
|
+
<fetched>2025-12-29</fetched>
|
|
113
|
+
<title language="en" script="Latn">7-bit coded character set</title>
|
|
114
|
+
<uri type="src">https://ecma-international.org/publications-and-standards/standards/ecma-6/</uri>
|
|
115
|
+
<uri type="pdf">https://ecma-international.org/wp-content/uploads/ECMA-6_6th_edition_december_1991.pdf</uri>
|
|
116
116
|
<docidentifier type="ECMA" primary="true">ECMA-6</docidentifier>
|
|
117
117
|
...
|
|
118
118
|
</bibitem>"
|
|
@@ -122,17 +122,18 @@ With `bibdata: true` option XML output wrapped with `bibdata` element and `ext`
|
|
|
122
122
|
[source,ruby]
|
|
123
123
|
----
|
|
124
124
|
item.to_xml bibdata: true
|
|
125
|
-
"<bibdata type="standard" schema-version="v1.
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
</
|
|
125
|
+
=> "<bibdata type="standard" schema-version="v1.4.1">
|
|
126
|
+
<fetched>2025-12-29</fetched>
|
|
127
|
+
<title language="en" script="Latn">7-bit coded character set</title>
|
|
128
|
+
<uri type="src">https://ecma-international.org/publications-and-standards/standards/ecma-6/</uri>
|
|
129
|
+
<uri type="pdf">https://ecma-international.org/wp-content/uploads/ECMA-6_6th_edition_december_1991.pdf</uri>
|
|
130
|
+
<docidentifier type="ECMA" primary="true">ECMA-6</docidentifier>
|
|
131
|
+
...
|
|
132
|
+
<ext schema-version="v1.0.0">
|
|
133
|
+
<doctype>document</doctype>
|
|
134
|
+
<flavor>ecma</flavor>
|
|
135
|
+
</ext>
|
|
136
|
+
</bibdata>"
|
|
136
137
|
----
|
|
137
138
|
|
|
138
139
|
=== Typed links
|
|
@@ -141,17 +142,23 @@ Each ECMA document has `src` and `doi` link types.
|
|
|
141
142
|
|
|
142
143
|
[source,ruby]
|
|
143
144
|
----
|
|
144
|
-
item.
|
|
145
|
-
=>
|
|
146
|
-
|
|
145
|
+
item.source
|
|
146
|
+
=>
|
|
147
|
+
[#<Relaton::Bib::Uri:0x00000001278dc5e8 @content="https://ecma-international.org/publications-and-standards/standards/ecma-6/", @language=nil, @locale=nil, @script=nil, @type="src">,
|
|
148
|
+
#<Relaton::Bib::Uri:0x00000001278dc188
|
|
149
|
+
@content="https://ecma-international.org/wp-content/uploads/ECMA-6_6th_edition_december_1991.pdf",
|
|
150
|
+
@language=nil,
|
|
151
|
+
@locale=nil,
|
|
152
|
+
@script=nil,
|
|
153
|
+
@type="pdf">]
|
|
147
154
|
----
|
|
148
155
|
|
|
149
156
|
=== Parse a file locally
|
|
150
157
|
|
|
151
158
|
[source,ruby]
|
|
152
159
|
----
|
|
153
|
-
item =
|
|
154
|
-
=> #<
|
|
160
|
+
item = Relaton::Ecma::Item.from_xml File.read("spec/fixtures/bibdata.xml")
|
|
161
|
+
=> #<Relaton::Ecma::ItemData:0x0000000127cbb1a0
|
|
155
162
|
...
|
|
156
163
|
----
|
|
157
164
|
|
|
@@ -159,7 +166,7 @@ item = RelatonEcma::XMLParser.from_xml File.read("spec/fixtures/bibdata.xml")
|
|
|
159
166
|
|
|
160
167
|
This gem uses a https://github.com/relaton/relaton-data-ecma[ecma-standards] prefetched dataset as a data source. The dataset contains documents from ECMA https://www.ecma-international.org/publications-and-standards/standards/[Standards], https://www.ecma-international.org/publications-and-standards/technical-reports/[Technical Reports], and https://www.ecma-international.org/publications-and-standards/mementos/[Mementos] pages.
|
|
161
168
|
|
|
162
|
-
The method `
|
|
169
|
+
The method `Relaton::Ecma::DataFetcher.new(output, format).fetch` fetches all the documents from the pages and saves them to the `./data` folder in YAML format.
|
|
163
170
|
Arguments:
|
|
164
171
|
|
|
165
172
|
- `output` - folder to save documents (default './data').
|
|
@@ -167,7 +174,7 @@ Arguments:
|
|
|
167
174
|
|
|
168
175
|
[source,ruby]
|
|
169
176
|
----
|
|
170
|
-
|
|
177
|
+
Relaton::Ecma::DataFetcher.new.fetch
|
|
171
178
|
Started at: 2022-06-23 09:36:55 +0200
|
|
172
179
|
Stopped at: 2022-06-23 09:36:58 +0200
|
|
173
180
|
Done in: 752 sec.
|
|
@@ -176,7 +183,7 @@ Done in: 752 sec.
|
|
|
176
183
|
|
|
177
184
|
=== Logging
|
|
178
185
|
|
|
179
|
-
|
|
186
|
+
Relaton::Ecma uses the relaton-logger gem for logging. By default, it logs to STDOUT. To change the log levels and add other loggers, read the https://github.com/relaton/relaton-logger#usage[relaton-logger] documentation.
|
|
180
187
|
|
|
181
188
|
== Development
|
|
182
189
|
|