relaton-bipm 1.20.4 → 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/CLAUDE.md +46 -0
- data/bin/console +1 -1
- data/grammars/basicdoc.rng +1559 -668
- data/grammars/biblio-standoc.rng +107 -46
- data/grammars/biblio.rng +1010 -375
- data/grammars/relaton-bipm.rng +19 -68
- data/lib/{relaton_bipm/bipm_bibliography.rb → relaton/bipm/bibliography.rb} +11 -11
- data/lib/relaton/bipm/converter/asciibib.rb +64 -0
- data/lib/relaton/bipm/data_fetcher.rb +52 -0
- data/lib/{relaton_bipm → relaton/bipm}/data_outcomes_parser.rb +108 -83
- data/lib/relaton/bipm/id_parser.rb +254 -0
- data/lib/relaton/bipm/item_data.rb +47 -0
- data/lib/relaton/bipm/model/bibdata.rb +9 -0
- data/lib/relaton/bipm/model/bibitem.rb +9 -0
- data/lib/relaton/bipm/model/comment_period.rb +13 -0
- data/lib/relaton/bipm/model/doctype.rb +12 -0
- data/lib/relaton/bipm/model/ext.rb +32 -0
- data/lib/relaton/bipm/model/item.rb +11 -0
- data/lib/relaton/bipm/model/structured_identifier.rb +15 -0
- data/lib/relaton/bipm/processor.rb +69 -0
- data/lib/{relaton_bipm → relaton/bipm}/rawdata_bipm_metrologia/affiliations.rb +17 -17
- data/lib/{relaton_bipm → relaton/bipm}/rawdata_bipm_metrologia/article_parser.rb +71 -66
- data/lib/{relaton_bipm → relaton/bipm}/rawdata_bipm_metrologia/fetcher.rb +20 -30
- data/lib/{relaton_bipm/bipm_si_brochure_parser.rb → relaton/bipm/si_brochure_parser.rb} +41 -37
- data/lib/relaton/bipm/util.rb +8 -0
- data/lib/relaton/bipm/version.rb +5 -0
- data/lib/relaton/bipm.rb +30 -0
- data/relaton_bipm.gemspec +7 -6
- metadata +44 -35
- data/lib/relaton_bipm/acronyms.yaml +0 -59
- data/lib/relaton_bipm/bibliographic_date.rb +0 -5
- data/lib/relaton_bipm/bipm_bibliographic_item.rb +0 -110
- data/lib/relaton_bipm/comment_periond.rb +0 -41
- data/lib/relaton_bipm/committee.rb +0 -67
- data/lib/relaton_bipm/data_fetcher.rb +0 -75
- data/lib/relaton_bipm/document_relation.rb +0 -5
- data/lib/relaton_bipm/document_type.rb +0 -29
- data/lib/relaton_bipm/editorial_group.rb +0 -50
- data/lib/relaton_bipm/hash_converter.rb +0 -115
- data/lib/relaton_bipm/id_parser.rb +0 -252
- data/lib/relaton_bipm/processor.rb +0 -62
- data/lib/relaton_bipm/structured_identifier.rb +0 -51
- data/lib/relaton_bipm/util.rb +0 -6
- data/lib/relaton_bipm/version.rb +0 -3
- data/lib/relaton_bipm/workgroup.rb +0 -46
- data/lib/relaton_bipm/xml_parser.rb +0 -103
- data/lib/relaton_bipm.rb +0 -40
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 66989948c2f106bc44e73e393c6a472e316583f10e706f72d38291d56d7444d8
|
|
4
|
+
data.tar.gz: 49a6b8a07c938e00d457b99cc1dc0b68444669285c409c767d284f5ed67dad1d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 50df0724589ad037136ed2a0fb4cfb18853824889c195bb8dc10c775814ecfe26d461760bd7524f5f2ab8efd790896368a93a51fb156b8566662992d1316435f
|
|
7
|
+
data.tar.gz: 713992adb1d5dcdecdeee048eee071f02d94cab99c426ea35f54d2e90e47c68b01f412faebd1ce165dd93f115d209e0afd0b5ed8d895bd8f9674765d31b406da
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
data/CLAUDE.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
4
|
+
|
|
5
|
+
## Project Overview
|
|
6
|
+
|
|
7
|
+
relaton-bipm is a Ruby gem that retrieves BIPM (Bureau International des Poids et Mesures) standards metadata for bibliographic use. It's part of the larger Relaton family of gems that handle bibliographic data for standards organizations.
|
|
8
|
+
|
|
9
|
+
## Common Commands
|
|
10
|
+
|
|
11
|
+
- **Install dependencies:** `bundle install`
|
|
12
|
+
- **Run all tests:** `bundle exec rake spec`
|
|
13
|
+
- **Run a single test file:** `bundle exec rspec spec/relaton/bipm/bibliography_spec.rb`
|
|
14
|
+
- **Run a single test by line:** `bundle exec rspec spec/relaton/bipm/bibliography_spec.rb:42`
|
|
15
|
+
- **Interactive console:** `bin/console`
|
|
16
|
+
|
|
17
|
+
## Architecture
|
|
18
|
+
|
|
19
|
+
### Namespace & Module Structure
|
|
20
|
+
|
|
21
|
+
All code lives under `Relaton::Bipm` (in `lib/relaton/bipm/`). The gem name is `relaton-bipm`, the require path is `relaton/bipm`.
|
|
22
|
+
|
|
23
|
+
### Key Components
|
|
24
|
+
|
|
25
|
+
- **`Bibliography`** (`bibliography.rb`) - Main entry point for fetching standards. Searches a relaton-data-bipm GitHub repository index to find and retrieve YAML bibliographic records.
|
|
26
|
+
- **`Id`** (`id_parser.rb`) - Parses BIPM reference strings into structured hashes using regex matching. Handles multiple reference formats: outcomes (resolutions, recommendations, decisions), SI Brochure, Metrologia journal articles, and JCGM documents. The `TYPES` hash maps full type names (English/French) to abbreviations (RES, REC, DECN, DECL).
|
|
27
|
+
- **`Processor`** (`processor.rb`) - Relaton framework integration point (extends `Relaton::Core::Processor`). Registers prefix `BIPM` and default prefix pattern matching BIPM, CCTF, CCDS, CGPM, CIPM, JCRB, JCGM.
|
|
28
|
+
- **`DataFetcher`** (`data_fetcher.rb`) - Bulk fetches from three data sources: `bipm-data-outcomes`, `bipm-si-brochure`, `rawdata-bipm-metrologia`. Delegates to specialized parsers.
|
|
29
|
+
- **`Item`** / **`ItemData`** (`model/item.rb`, `item_data.rb`) - The bibliographic item model, extending `Relaton::Bib::Item`. Supports XML, YAML, and JSON serialization.
|
|
30
|
+
- **`model/`** directory - Lutaml model classes (Bibdata, Bibitem, Ext, etc.) for XML/YAML serialization.
|
|
31
|
+
|
|
32
|
+
### Data Sources
|
|
33
|
+
|
|
34
|
+
The gem fetches from three external datasets:
|
|
35
|
+
|
|
36
|
+
1. **bipm-data-outcomes** - CGPM/CIPM/committee resolutions, recommendations, decisions
|
|
37
|
+
2. **bipm-si-brochure** - SI Brochure documents
|
|
38
|
+
3. **rawdata-bipm-metrologia** - Metrologia journal articles (parsed from CrossRef-style data)
|
|
39
|
+
|
|
40
|
+
### Testing
|
|
41
|
+
|
|
42
|
+
Tests use RSpec with VCR cassettes (`spec/vcr_cassettes/`) to record/replay HTTP interactions. WebMock is used to prevent real HTTP requests during tests. Test fixtures are in `spec/fixtures/`.
|
|
43
|
+
|
|
44
|
+
### Dependencies
|
|
45
|
+
|
|
46
|
+
Key runtime dependencies: `relaton-bib` (core bibliographic model), `relaton-index` (index management), `relaton-core` (framework base), `parslet` (PEG parser), `mechanize` (HTTP), `faraday`, `rubyzip`.
|
data/bin/console
CHANGED