relaton-ieee 1.20.2 → 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.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.rubocop.yml +1 -1
  4. data/README.adoc +32 -33
  5. data/grammars/basicdoc.rng +1559 -671
  6. data/grammars/biblio-standoc.rng +107 -46
  7. data/grammars/biblio.rng +1010 -375
  8. data/grammars/relaton-ieee.rng +44 -79
  9. data/lib/relaton/ieee/balloting_group.rb +13 -0
  10. data/lib/relaton/ieee/bibdata.rb +7 -0
  11. data/lib/relaton/ieee/bibitem.rb +7 -0
  12. data/lib/relaton/ieee/bibliography.rb +51 -0
  13. data/lib/relaton/ieee/converter/bibxml/from_rfcxml.rb +10 -0
  14. data/lib/relaton/ieee/converter/bibxml/from_rfcxml_referencegroup.rb +10 -0
  15. data/lib/relaton/ieee/converter/bibxml.rb +20 -0
  16. data/lib/relaton/ieee/data_fetcher.rb +192 -0
  17. data/lib/relaton/ieee/doctype.rb +9 -0
  18. data/lib/relaton/ieee/editorial_group.rb +19 -0
  19. data/lib/relaton/ieee/ext.rb +37 -0
  20. data/lib/relaton/ieee/idams_parser.rb +282 -0
  21. data/lib/relaton/ieee/item.rb +11 -0
  22. data/lib/relaton/ieee/item_data.rb +7 -0
  23. data/lib/relaton/ieee/processor.rb +68 -0
  24. data/lib/relaton/ieee/pub_id.rb +161 -0
  25. data/lib/relaton/ieee/rawbib_id_parser.rb +548 -0
  26. data/lib/relaton/ieee/util.rb +8 -0
  27. data/lib/relaton/ieee/version.rb +5 -0
  28. data/lib/relaton/ieee.rb +29 -0
  29. data/relaton_ieee.gemspec +8 -7
  30. metadata +44 -31
  31. data/lib/relaton_ieee/balloting_group.rb +0 -56
  32. data/lib/relaton_ieee/bibxml_parser.rb +0 -23
  33. data/lib/relaton_ieee/data_fetcher.rb +0 -221
  34. data/lib/relaton_ieee/document_status.rb +0 -14
  35. data/lib/relaton_ieee/document_type.rb +0 -16
  36. data/lib/relaton_ieee/editorial_group.rb +0 -83
  37. data/lib/relaton_ieee/hash_converter.rb +0 -45
  38. data/lib/relaton_ieee/idams_parser.rb +0 -254
  39. data/lib/relaton_ieee/ieee_bibliographic_item.rb +0 -124
  40. data/lib/relaton_ieee/ieee_bibliography.rb +0 -53
  41. data/lib/relaton_ieee/processor.rb +0 -60
  42. data/lib/relaton_ieee/pub_id.rb +0 -159
  43. data/lib/relaton_ieee/rawbib_id_parser.rb +0 -546
  44. data/lib/relaton_ieee/renderer/bibxml.rb +0 -17
  45. data/lib/relaton_ieee/util.rb +0 -6
  46. data/lib/relaton_ieee/version.rb +0 -3
  47. data/lib/relaton_ieee/xml_parser.rb +0 -66
  48. data/lib/relaton_ieee.rb +0 -30
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8322acea67174d16d3ce1b6ee15eed64f3bf6f84cc15042c5d41aa1ad339a8a0
4
- data.tar.gz: 61d77da0f64037308ead04f5a89b3519d465a8a62cd56e3442134bc9ebbe4014
3
+ metadata.gz: 765f4c9699411cdd840df5690cc10b533d5ed6ae7ef85feec98b1dcbda2bb297
4
+ data.tar.gz: c3b231bcdd964782ee0841fabdbe8faa29f46c63abee8cda0088b47ec79d0a8e
5
5
  SHA512:
6
- metadata.gz: b7a0fd3d0c7ea17697dccfd487e1f6d05650e871307067844ab2a0ca5f8e83d4bafffb0bd8e0876034cdc566dcd6575970ac8f993f36741f9627e1625a632c32
7
- data.tar.gz: '038d169eb81819377924a0c6cf59474c85c9208f0abc359c187285eb9eb5e1f2ab2e3c0175b3d7a867c4e26b43b32219d2aa25641f3539d6d91443bc5ec258cf'
6
+ metadata.gz: 26c1d06d839bf86ca67e63b5ca0bf61ce7ad461f1419ef2f6e48796b52f11a88f9e9ebdbc20bd49bc208ffe6f8fd572d9240f6edd690177d1e155e7fdb0eedbc
7
+ data.tar.gz: 868e7cdfae66dcd56935973e3a236f5b4e702fcfe67205ca3a0b57f14e9cda49a2ec02bf10ff9f84ed5c892e158c2481568b2567b21045d66682d91b64fce4e8
data/.gitignore CHANGED
@@ -14,3 +14,4 @@
14
14
  .vscode/
15
15
  ieee-rawbib
16
16
  Gemfile.lock
17
+ .claude/
data/.rubocop.yml CHANGED
@@ -7,6 +7,6 @@ require: rubocop-rails
7
7
  inherit_from:
8
8
  - https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
9
9
  AllCops:
10
- TargetRubyVersion: 3.1
10
+ TargetRubyVersion: 3.2
11
11
  Rails:
12
12
  Enabled: false
data/README.adoc CHANGED
@@ -1,8 +1,8 @@
1
- = RelatonIeee
1
+ = Relaton::Ieee
2
2
 
3
3
  RelatonIeee is a Ruby gem that implements the https://github.com/relaton/relaton-model-ieee#ieee-bibliographic-item-model[IeeeBibliographicItem model].
4
4
 
5
- You can use it to retrieve metadata of IEEE Standards from standards.ieee.org, and access such metadata through the `IeeeBibliographicItem` object.
5
+ You can use it to retrieve metadata of IEEE Standards from standards.ieee.org, and access such metadata through the `Relaton::Ieee::ItemData` object.
6
6
 
7
7
  == Installation
8
8
 
@@ -27,11 +27,11 @@ Or install it yourself as:
27
27
 
28
28
  [source,ruby]
29
29
  ----
30
- require 'relaton_ieee'
30
+ require 'relaton/ieee'
31
31
  => true
32
32
 
33
- item = RelatonIeee::IeeeBibliography.search("IEEE 528-2019")
34
- => #<RelatonIeee::IeeeBibliographicItem:0x00007fe12ebc8cb8
33
+ item = Relaton::Ieee::Bibliography.search("IEEE Std 528-2019")
34
+ => #<Relaton::Ieee::ItemData:0x000000012891cf70
35
35
  ...
36
36
  ----
37
37
 
@@ -40,11 +40,11 @@ item = RelatonIeee::IeeeBibliography.search("IEEE 528-2019")
40
40
  [source,ruby]
41
41
  ----
42
42
  item.to_xml
43
- => "<bibitem id="IEEE528-2019" type="standard" schema-version="v1.2.1">
44
- <fetched>2022-12-03</fetched>
45
- <title type="main" format="text/plain">IEEE Standard for Inertial Sensor Terminology</title>
43
+ => "<bibitem id="IEEEStd5282019" type="standard" schema-version="v1.4.1">
44
+ <fetched>2026-01-30</fetched>
45
+ <title type="main">IEEE Standard for Inertial Sensor Terminology</title>
46
46
  <uri type="src">https://ieeexplore.ieee.org/document/8863799</uri>
47
- <docidentifier type="IEEE" primary="true">IEEE 528-2019</docidentifier>
47
+ <docidentifier type="IEEE" primary="true">IEEE Std 528-2019</docidentifier>
48
48
  ...
49
49
  </bibitem>"
50
50
  ----
@@ -54,16 +54,15 @@ With argument `bibdata: true` it ouputs XML wrapped by `bibdata` element and add
54
54
  [source,ruby]
55
55
  ----
56
56
  item.to_xml bibdata: true
57
- => "<bibdata type="standard" schema-version="v1.2.1">
58
- <fetched>2022-12-03</fetched>
59
- <title type="main" format="text/plain">IEEE Standard for Inertial Sensor Terminology</title>
57
+ => "<bibdata type="standard" schema-version="v1.4.1">
58
+ <fetched>2026-01-30</fetched>
59
+ <title type="main">IEEE Standard for Inertial Sensor Terminology</title>
60
60
  <uri type="src">https://ieeexplore.ieee.org/document/8863799</uri>
61
- <docidentifier type="IEEE" primary="true">IEEE 528-2019</docidentifier>
61
+ <docidentifier type="IEEE" primary="true">IEEE Std 528-2019</docidentifier>
62
62
  ...
63
63
  <ext schema-version="v1.0.1">
64
- <editorialgroup>
65
- <committee>Gyro Accelerometer Panel of the IEEE Aerospace and Electronic Systems Society</committee>
66
- </editorialgroup>
64
+ <doctype>standard</doctype>
65
+ <flavor>ieee</flavor>
67
66
  ...
68
67
  </ext>
69
68
  </bibdata>"
@@ -72,40 +71,39 @@ item.to_xml bibdata: true
72
71
  === Get document by reference
73
72
  [source,ruby]
74
73
  ----
75
- RelatonIeee::IeeeBibliography.get("IEEE 528-2019")
76
- [relaton-ieee] (IEEE 528-2019) fetching...
77
- [relaton-ieee] (IEEE 528-2019) found `IEEE 528-2019`
78
- => #<RelatonIeee::IeeeBibliographicItem:0x007fceb52a6e40
74
+ Relaton::Ieee::Bibliography.get("IEEE Std 528-2019")
75
+ [relaton-ieee] INFO: (IEEE Std 528-2019) Fetching from Relaton repository ...
76
+ [relaton-ieee] INFO: (IEEE Std 528-2019) Found: `IEEE Std 528-2019`
77
+ => #<Relaton::Ieee::ItemData:0x00000001288b9380
79
78
  ...
80
79
  ----
81
80
 
82
- === Typed links
81
+ === Typed source links
83
82
 
84
83
  Each IEEE document has `src` type link.
85
84
 
86
85
  [source,ruby]
87
86
  ----
88
- item.link
89
- => [#<RelatonBib::TypedUri:0x00007fe885219ba0 @content=#<Addressable::URI:0x8ac URI:https://standards.ieee.org/standard/528-2019.html>, @type="src">]
87
+ item.source.first.type
88
+ => "src"
89
+
90
+ item.source.first.content
91
+ => "https://ieeexplore.ieee.org/document/8863799"
90
92
  ----
91
93
 
92
94
  === Create bibliographic item from XML
93
95
  [source,ruby]
94
96
  ----
95
- RelatonIeee::XMLParser.from_xml File.read "spec/fixtures/ieee_528_2019.xml"
96
- => #<RelatonIeee::IeeeBibliographicItem:0x007fceb550c978
97
+ Relaton::Ieee::Item.from_xml File.read "spec/fixtures/ieee_528_2019.xml"
98
+ => #<Relaton::Ieee::ItemData:0x0000000128815a00
97
99
  ...
98
100
  ----
99
101
 
100
102
  === Create bibliographic item from YAML
101
103
  [source,ruby]
102
104
  ----
103
- hash = YAML.load_file 'spec/fixtures/ieee_528_2019.yaml'
104
- => {"id"=>"IEEE528-2019",
105
- ...
106
-
107
- RelatonIeee::IeeeBibliographicItem.from_hash hash
108
- => #<RelatonIeee::IeeeBibliographicItem:0x007fce940b3eb0
105
+ Relaton::Ieee::Item.from_yaml File.read('spec/fixtures/item.yaml')
106
+ => #<Relaton::Ieee::ItemData:0x0000000122f70c88
109
107
  ...
110
108
  ----
111
109
 
@@ -113,15 +111,16 @@ hash = YAML.load_file 'spec/fixtures/ieee_528_2019.yaml'
113
111
 
114
112
  There is an IEEE dataset https://github.com/relaton/ieee-rawbib which can be converted into BibXML/BibYAML formats. The dataset needs to be placed into the local directory.
115
113
 
116
- The method `RelatonIeee::DataFetcher.fetch(output: "data", format: "yaml")` converts all the documents from the local `ieee-rawbib` directory and saves them to the `./data` folder in YAML format.
114
+ The method `Relaton::Ieee::DataFetcher.fetch(source, output: "data", format: "yaml")` converts all the documents from the local `ieee-rawbib` directory and saves them to the `./data` folder in YAML format.
117
115
  Arguments:
118
116
 
117
+ - `source` - a name of data source (default 'ieee-rawbib').
119
118
  - `output` - folder to save documents (default './data').
120
119
  - `format` - the format in which the documents are saved. Possible formats are: `yaml`, `xml` (default `yaml`).
121
120
 
122
121
  [source,ruby]
123
122
  ----
124
- RelatonIeee::DataFetcher.fetch
123
+ Relaton::Ieee::DataFetcher.fetch
125
124
  Started at: 2021-09-24 17:55:07 +0200
126
125
  Stopped at: 2021-09-24 17:57:30 +0200
127
126
  Done in: 143 sec.