relaton 3.0.8 → 3.1.0
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/lib/relaton/3gpp/processor.rb +1 -1
- data/lib/relaton/3gpp.rb +3 -3
- data/lib/relaton/adobe/processor.rb +1 -1
- data/lib/relaton/adobe.rb +3 -3
- data/lib/relaton/bib/item_data.rb +2 -2
- data/lib/relaton/bib.rb +2 -2
- data/lib/relaton/bibcollection.rb +1 -1
- data/lib/relaton/bipm/processor.rb +1 -1
- data/lib/relaton/bipm.rb +3 -3
- data/lib/relaton/bsi/processor.rb +1 -1
- data/lib/relaton/bsi.rb +1 -1
- data/lib/relaton/calconnect/data_fetcher.rb +2 -2
- data/lib/relaton/calconnect/model/item.rb +1 -1
- data/lib/relaton/calconnect/processor.rb +1 -1
- data/lib/relaton/calconnect.rb +2 -2
- data/lib/relaton/ccsds/data/fetcher.rb +1 -1
- data/lib/relaton/ccsds/model/item.rb +1 -1
- data/lib/relaton/ccsds/processor.rb +1 -1
- data/lib/relaton/ccsds/util.rb +1 -1
- data/lib/relaton/ccsds.rb +1 -1
- data/lib/relaton/cen/processor.rb +1 -1
- data/lib/relaton/cen.rb +2 -2
- data/lib/relaton/cie/data_fetcher.rb +3 -3
- data/lib/relaton/cie/processor.rb +1 -1
- data/lib/relaton/cie.rb +2 -2
- data/lib/relaton/cli/base_convertor.rb +3 -3
- data/lib/relaton/cli/command.rb +15 -9
- data/lib/relaton/cli/index_site_generator.rb +34 -6
- data/lib/relaton/cli/relaton_file.rb +4 -4
- data/lib/relaton/cli/subcommand_collection.rb +1 -1
- data/lib/relaton/cli/xml_convertor.rb +1 -1
- data/lib/relaton/cli/yaml_convertor.rb +2 -2
- data/lib/relaton/cli.rb +1 -11
- data/lib/relaton/core/processor.rb +1 -1
- data/lib/relaton/core.rb +1 -1
- data/lib/relaton/db/registry.rb +1 -1
- data/lib/relaton/db.rb +1 -1
- data/lib/relaton/doi/parser.rb +2 -1
- data/lib/relaton/doi/processor.rb +1 -1
- data/lib/relaton/doi.rb +4 -4
- data/lib/relaton/easc/processor.rb +1 -1
- data/lib/relaton/easc.rb +3 -3
- data/lib/relaton/ecma/data_fetcher.rb +1 -1
- data/lib/relaton/ecma/processor.rb +1 -1
- data/lib/relaton/ecma.rb +2 -2
- data/lib/relaton/etsi/data_fetcher.rb +2 -2
- data/lib/relaton/etsi/item.rb +1 -1
- data/lib/relaton/etsi/processor.rb +2 -2
- data/lib/relaton/etsi.rb +1 -1
- data/lib/relaton/evs/processor.rb +1 -1
- data/lib/relaton/evs.rb +2 -2
- data/lib/relaton/gb/bibliography.rb +1 -1
- data/lib/relaton/gb/processor.rb +1 -1
- data/lib/relaton/gb.rb +2 -2
- data/lib/relaton/gost/processor.rb +1 -1
- data/lib/relaton/gost.rb +3 -3
- data/lib/relaton/iala/processor.rb +1 -1
- data/lib/relaton/iala.rb +3 -3
- data/lib/relaton/iana/data_fetcher.rb +1 -1
- data/lib/relaton/iana/processor.rb +1 -1
- data/lib/relaton/iana.rb +2 -2
- data/lib/relaton/iec/data_fetcher.rb +1 -1
- data/lib/relaton/iec/processor.rb +1 -1
- data/lib/relaton/iec.rb +2 -2
- data/lib/relaton/ieee/processor.rb +1 -1
- data/lib/relaton/ieee.rb +2 -2
- data/lib/relaton/ietf/data_fetcher.rb +1 -1
- data/lib/relaton/ietf/processor.rb +1 -1
- data/lib/relaton/ietf.rb +2 -2
- data/lib/relaton/iho/hash_parser_v1.rb +1 -1
- data/lib/relaton/iho/processor.rb +1 -1
- data/lib/relaton/iho.rb +2 -2
- data/lib/relaton/index.rb +1 -1
- data/lib/relaton/isbn/processor.rb +1 -1
- data/lib/relaton/isbn.rb +1 -1
- data/lib/relaton/iso/hash_parser_v1.rb +1 -1
- data/lib/relaton/iso/processor.rb +1 -1
- data/lib/relaton/iso.rb +3 -3
- data/lib/relaton/itu/processor.rb +1 -1
- data/lib/relaton/itu.rb +3 -3
- data/lib/relaton/jcgm/processor.rb +1 -1
- data/lib/relaton/jcgm.rb +2 -2
- data/lib/relaton/jis/processor.rb +1 -1
- data/lib/relaton/jis.rb +2 -2
- data/lib/relaton/nist/processor.rb +1 -1
- data/lib/relaton/nist.rb +2 -2
- data/lib/relaton/oasis/processor.rb +1 -1
- data/lib/relaton/oasis.rb +2 -2
- data/lib/relaton/ogc/processor.rb +1 -1
- data/lib/relaton/ogc.rb +2 -2
- data/lib/relaton/oiml/processor.rb +1 -1
- data/lib/relaton/oiml.rb +2 -2
- data/lib/relaton/omg/processor.rb +1 -1
- data/lib/relaton/omg.rb +1 -1
- data/lib/relaton/plateau/data_fetcher.rb +1 -1
- data/lib/relaton/plateau/processor.rb +1 -1
- data/lib/relaton/plateau.rb +2 -2
- data/lib/relaton/render/iso690/elements/extent.rb +1 -1
- data/lib/relaton/sae/CLAUDE.md +89 -0
- data/lib/relaton/sae/bibdata.rb +8 -0
- data/lib/relaton/sae/bibitem.rb +8 -0
- data/lib/relaton/sae/bibliography.rb +128 -0
- data/lib/relaton/sae/data_fetcher.rb +219 -0
- data/lib/relaton/sae/doi_code.rb +83 -0
- data/lib/relaton/sae/item.rb +10 -0
- data/lib/relaton/sae/item_data.rb +6 -0
- data/lib/relaton/sae/processor.rb +62 -0
- data/lib/relaton/sae/util.rb +9 -0
- data/lib/relaton/sae.rb +37 -0
- data/lib/relaton/un/processor.rb +1 -1
- data/lib/relaton/un.rb +1 -1
- data/lib/relaton/version.rb +1 -1
- data/lib/relaton/w3c/bibliography.rb +1 -1
- data/lib/relaton/w3c/data_fetcher.rb +1 -1
- data/lib/relaton/w3c/processor.rb +1 -1
- data/lib/relaton/w3c.rb +2 -2
- data/lib/relaton/xsf/data_fetcher.rb +1 -1
- data/lib/relaton/xsf/processor.rb +1 -1
- data/lib/relaton/xsf.rb +2 -2
- data/lib/relaton-cli.rb +2 -2
- data/lib/relaton-render.rb +1 -2
- data/lib/relaton.rb +3 -2
- metadata +16 -7
- data/lib/relaton/cli/version.rb +0 -11
- data/lib/relaton/render/version.rb +0 -5
data/lib/relaton/evs.rb
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
require "digest/md5"
|
|
4
4
|
require "mechanize"
|
|
5
|
-
|
|
5
|
+
require_relative "core"
|
|
6
6
|
require "isoics"
|
|
7
7
|
require "pubid"
|
|
8
|
-
|
|
8
|
+
require_relative "bib"
|
|
9
9
|
require_relative "version"
|
|
10
10
|
require_relative "evs/util"
|
|
11
11
|
require_relative "evs/model/item"
|
data/lib/relaton/gb/processor.rb
CHANGED
data/lib/relaton/gb.rb
CHANGED
data/lib/relaton/gost.rb
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
require_relative "bib"
|
|
4
|
+
require_relative "index"
|
|
5
5
|
require "pubid"
|
|
6
|
-
|
|
6
|
+
require_relative "version"
|
|
7
7
|
|
|
8
8
|
# Relaton::Gost is the GOST (Russian federal standards — Гостстандарт)
|
|
9
9
|
# flavor of the unified relaton gem. Adds typed Ext fields (urn,
|
data/lib/relaton/iala.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require "pubid"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
require_relative "bib"
|
|
3
|
+
require_relative "index"
|
|
4
|
+
require_relative "version"
|
|
5
5
|
|
|
6
6
|
# Relaton::Iala is the IALA (International Organization for Marine Aids
|
|
7
7
|
# to Navigation) flavor of the unified relaton gem. Adds typed Ext fields
|
data/lib/relaton/iana.rb
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require "faraday"
|
|
4
|
-
|
|
4
|
+
require_relative "index"
|
|
5
5
|
require "pubid"
|
|
6
|
-
|
|
6
|
+
require_relative "bib"
|
|
7
7
|
require_relative "version"
|
|
8
8
|
require_relative "iana/util"
|
|
9
9
|
require_relative "iana/item_data"
|
data/lib/relaton/iec.rb
CHANGED
|
@@ -3,8 +3,8 @@ require "net/http"
|
|
|
3
3
|
require "moxml"
|
|
4
4
|
require "pubid"
|
|
5
5
|
require "zip"
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
require_relative "index"
|
|
7
|
+
require_relative "iso"
|
|
8
8
|
require_relative "version"
|
|
9
9
|
require_relative "iec/util"
|
|
10
10
|
require_relative "iec/bibliography"
|
data/lib/relaton/ieee.rb
CHANGED
|
@@ -2,8 +2,8 @@ require "digest/md5"
|
|
|
2
2
|
require "faraday"
|
|
3
3
|
require "yaml"
|
|
4
4
|
require "pubid"
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
require_relative "index"
|
|
6
|
+
require_relative "bib"
|
|
7
7
|
require_relative "version"
|
|
8
8
|
require_relative "ieee/util"
|
|
9
9
|
require_relative "ieee/bibliography"
|
data/lib/relaton/ietf.rb
CHANGED
data/lib/relaton/iho.rb
CHANGED
data/lib/relaton/index.rb
CHANGED
data/lib/relaton/isbn.rb
CHANGED
data/lib/relaton/iso.rb
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
require "net/http"
|
|
4
4
|
require "pubid"
|
|
5
|
-
|
|
5
|
+
require_relative "index"
|
|
6
6
|
require "isoics"
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
require_relative "bib"
|
|
8
|
+
require_relative "core"
|
|
9
9
|
require_relative "version"
|
|
10
10
|
require_relative "iso/util"
|
|
11
11
|
require_relative "iso/item_data"
|
data/lib/relaton/itu.rb
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
require "mechanize"
|
|
2
2
|
require "pubid"
|
|
3
3
|
require "digest/md5"
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
require_relative "index"
|
|
5
|
+
require_relative "bib"
|
|
6
|
+
require_relative "core"
|
|
7
7
|
require_relative "version"
|
|
8
8
|
require_relative "itu/util"
|
|
9
9
|
require_relative "itu/item_data"
|
data/lib/relaton/jcgm.rb
CHANGED
data/lib/relaton/jis.rb
CHANGED
data/lib/relaton/nist.rb
CHANGED
data/lib/relaton/oasis.rb
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
# (The IANA/IHO/IALA/OGC/ECMA form; spec/relaton/lazy_loading_spec.rb guards
|
|
6
6
|
# that this file is not itself loaded when a Db is built.)
|
|
7
7
|
require "pubid"
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
require_relative "index"
|
|
9
|
+
require_relative "bib"
|
|
10
10
|
require_relative "version"
|
|
11
11
|
require_relative "oasis/util"
|
|
12
12
|
require_relative "oasis/item_data"
|
data/lib/relaton/ogc.rb
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
# index code names. Processor#remove_index_file names no pubid class: the
|
|
3
3
|
# delete never reads the index (see lib/relaton/index/CLAUDE.md).
|
|
4
4
|
require "pubid"
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
require_relative "index"
|
|
6
|
+
require_relative "iso"
|
|
7
7
|
require_relative "version"
|
|
8
8
|
require_relative "ogc/util"
|
|
9
9
|
require_relative "ogc/item_data"
|
data/lib/relaton/oiml.rb
CHANGED
data/lib/relaton/omg.rb
CHANGED
data/lib/relaton/plateau.rb
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
require "net/http"
|
|
2
2
|
require "uri"
|
|
3
3
|
require "pubid"
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
require_relative "index"
|
|
5
|
+
require_relative "iso"
|
|
6
6
|
require_relative "version"
|
|
7
7
|
require_relative "plateau/util"
|
|
8
8
|
# require_relative "plateau/docidentifier"
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# CLAUDE.md — SAE flavor
|
|
2
|
+
|
|
3
|
+
`Relaton::Sae` fetches SAE International standards (relaton/relaton-sae#1).
|
|
4
|
+
|
|
5
|
+
## Development
|
|
6
|
+
|
|
7
|
+
- `bundle exec rake spec:sae` — this flavor's suite (from the repo root).
|
|
8
|
+
- No VCR: the specs stub HTTP with WebMock. `spec/sae/fixtures/crossref/`
|
|
9
|
+
holds three Crossref cursor pages built from real records (11 works:
|
|
10
|
+
six J3016/J3194 editions, three AMS4121 revisions, a part and a
|
|
11
|
+
letter-pair number). `spec/sae/fixtures/index-v2.yaml` and `fixtures/data/` are the
|
|
12
|
+
**output of `DataFetcher` over those pages**: regenerate both together by
|
|
13
|
+
running the crawler over the page fixtures, never by hand.
|
|
14
|
+
|
|
15
|
+
## Where the data comes from
|
|
16
|
+
|
|
17
|
+
**sae.org answers every script request with a CAPTCHA** (product pages and
|
|
18
|
+
search alike), so no scraper is possible. SAE deposits every standard edition
|
|
19
|
+
with Crossref instead: prefix `10.4271`, type `standard`, ~47,700 records. The
|
|
20
|
+
DOI suffix is SAE's own edition code in lowercase:
|
|
21
|
+
|
|
22
|
+
| DOI | SAE code | scheme |
|
|
23
|
+
|---|---|---|
|
|
24
|
+
| `10.4271/j3016_202104` | `SAE J3016_202104` | J-series: `_YYYYMM` edition date |
|
|
25
|
+
| `10.4271/ams4121j` | `SAE AMS4121J` | aerospace: revision letter, no date |
|
|
26
|
+
| `10.4271/j2337/2_201702` | `SAE J2337/2_201702` | a part |
|
|
27
|
+
|
|
28
|
+
Crossref's text search does **not** find a standard by its id (it matches
|
|
29
|
+
titles), so an undated reference cannot be answered live. The flavor is
|
|
30
|
+
therefore index-based, the ECMA/IALA shape:
|
|
31
|
+
|
|
32
|
+
- **Producer** — `DataFetcher` (`relaton fetch-data sae-crossref`) walks
|
|
33
|
+
`api.crossref.org/prefixes/10.4271/works?filter=type:standard` with the
|
|
34
|
+
deep-paging cursor (1000 a request, one request a second through
|
|
35
|
+
`Core::Pacer`; 429/5xx and transport errors retried with back-off, five
|
|
36
|
+
attempts, then `RequestError`, because
|
|
37
|
+
a partial crawl would publish a partial index). Each work goes through
|
|
38
|
+
`Relaton::Doi::Parser`, then gets SAE's code as its **primary**
|
|
39
|
+
docidentifier (type `SAE`), the DOI beside it, and `ext` doctype
|
|
40
|
+
`standard`, flavor `sae`.
|
|
41
|
+
- **Consumer** — `Bibliography.get` reads the `relaton-data-sae` Pages index
|
|
42
|
+
(`PAGES_URL`) and the document from `ENDPOINT` (raw GitHub).
|
|
43
|
+
|
|
44
|
+
## Three identifier forms
|
|
45
|
+
|
|
46
|
+
`DoiCode` gives each record three strings:
|
|
47
|
+
|
|
48
|
+
- `#native` — the code in the DOI's spelling, `SAE J3016_202104`,
|
|
49
|
+
`SAE AMSQQA250/4B`. The output file is named after it
|
|
50
|
+
(`data/sae-amsqqa250-4b.yaml`), so a file name never depends on pubid.
|
|
51
|
+
- `#printed` — the code as SAE prints it (`SAE AMS-QQ-A-250/4B`): pubid's
|
|
52
|
+
render of the native code, or the native code when pubid cannot read it.
|
|
53
|
+
It is the primary docidentifier.
|
|
54
|
+
- `#reference` — what the index row is parsed from: the native code when the
|
|
55
|
+
DOI has a date, else the code with the year of the record's `approved` date
|
|
56
|
+
(`SAE AMS4121J:2017`), so a dated reference also reaches an aerospace
|
|
57
|
+
revision.
|
|
58
|
+
|
|
59
|
+
`Pubid::Sae` (pubid >= 2.0.9, pubid#665) reads all three, the month
|
|
60
|
+
included, so the `Db` keys the query and the fetched document with the
|
|
61
|
+
default `cache_pubid`. A reference pubid cannot read (`SAE J3016_2021`,
|
|
62
|
+
`SAE CPGM2016`) answers nil with a log line (relaton#235); it does not raise.
|
|
63
|
+
|
|
64
|
+
## Selection
|
|
65
|
+
|
|
66
|
+
`index.search(pubid)` with no block, so the subset match `query === row`:
|
|
67
|
+
a revision, a year or a month the query omits matches any value; the type
|
|
68
|
+
(`J`, `AMS`, …) is compared, and a part and an amendment are `subset_strict`
|
|
69
|
+
(`SAE J2337` does not answer with `SAE J2337/2`). Of the matches the highest
|
|
70
|
+
revision wins (`[length, letters]`, so `AA` follows `Z`), then the latest
|
|
71
|
+
year and month, then the file name (the index sort is not stable). A year
|
|
72
|
+
argument goes on a **copy** of a pubid handed in by `Db`.
|
|
73
|
+
|
|
74
|
+
The index key carries the month, so two editions of one year are two rows.
|
|
75
|
+
Two DOIs that spell one code (`ams-4121j`, `ams4121j`) share a key, and
|
|
76
|
+
`DataFetcher#add_to_index` keeps the later one (DOI date, then approval
|
|
77
|
+
date).
|
|
78
|
+
|
|
79
|
+
## What pubid still cannot read
|
|
80
|
+
|
|
81
|
+
About 960 of the ~47,700 deposits: 791 `CP*` collected-paper products (not
|
|
82
|
+
standards) and ~170 one-off shapes (`SUP1` supplements, language tails such
|
|
83
|
+
as `_PTBR`, `_4Q2012`, `_MMYYYY` dates). See pubid's `lib/pubid/sae/CLAUDE.md`.
|
|
84
|
+
Such a record is written, reported in `@errors` (the crawl's GitHub issue),
|
|
85
|
+
and not indexed: one row that fails to deserialize makes `Relaton::Index`
|
|
86
|
+
reject the whole index.
|
|
87
|
+
|
|
88
|
+
A multi-letter tail stays in `number` (`J1939DA`, and also `AMS4121AA`), so
|
|
89
|
+
a two-letter revision is its own bucket: `SAE AMS4121` does not reach it.
|