Coder Social home page Coder Social logo

bipm-data-importer's Introduction

BIPM data importer for CIPM and CGPM outcomes

Purpose

Provides executables that help fetch CIPM and CGPM outcomes from the official BIPM website.

Usage

To fetch CGPM outcomes:

$ bipm-fetch-cgpm

To fetch CIPM outcomes:

$ bipm-fetch-cipm

To fetch CIPM decisions:

$ bipm-fetch-cipm-decisions

License

Copyright Ribose. MIT license.

bipm-data-importer's People

Contributors

camobap avatar ronaldtse avatar webdev778 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bipm-data-importer's Issues

Update URLs for `pdf` and `reference`

From Janet Miles of BIPM:

In the YAML files:

I see that two different URLs are given for the “pdf” and “reference” (which correspond to the document on the BIPM website).
Can you please omit the segment “?version=1.3&download=true”, and for the links use the versions as given on https://www.bipm.org/en/committees/cg/cgpm/publications, https://www.bipm.org/en/committees/ci/cipm/publications, https://www.bipm.org/en/committees/ci/cipm/older-meeting-reports, https://www.bipm.org/en/committees/cc/cctf/publications
(Unfortunately the documents are posted twice.)

Update data importer code to work with latest BIPM website, import all consultative committees

BIPM has updated their website to now provide information from the consultative committees.

You can find this list in the header of the BIPM website:
Screen Shot 2022-10-26 at 2 29 28 PM

We would need obtain the information from those committees:

The types of data include:

  • publications
  • meetings
    • decisions
    • resolutions
    • documents
  • working groups
    • meetings
      • decisions
      • resolutions
      • documents

Ruby Psych fails to parse correctly formatted YAML dates

metadata:
  title: 'Resolutions of the CGPM: 1st meeting'
  date: 1889-09-28
  source: BIPM - Pavillon de Breteuil
  url: https://www.bipm.org/en/CGPM/db/1
resolutions:
- dates:
  - 1889-09-28

The 1889-09-28 date instances will fail on YAML.load like this:

Failure/Error: YAML.load_file(Pathname.new(f).expand_path.to_s)

Psych::DisallowedClass:
  Tried to load unspecified class: Date
# (eval):2:in `date'
# ./spec/bipm/data/importer/cgpm_spec.rb:8:in `block (2 levels) in <top (required)>'
# ./spec/bipm/data/importer/cgpm_spec.rb:6:in `map'
# ./spec/bipm/data/importer/cgpm_spec.rb:6:in `block in <top (required)>'
# ./spec/bipm/data/importer/cgpm_spec.rb:3:in `<top (required)>'

The reason is the Psych YAML parser at Ruby has the following bug but it was never fixed, for 6 years!
ruby/psych#262

In that ticket some suggested that only "invalid dates" will raise this issue, but the case is all dates will cause this issue. This is frustrating because the YAML spec does support the "Date" type.

Simply speaking:

irb(main):004:0> YAML.load("1900-01-01")
~/.rbenv/versions/3.1.0/lib/ruby/3.1.0/psych/class_loader.rb:99:in `find': Tried to load unspecified class: Date (Psych::DisallowedClass)

Update data importer to import with updated "types"

The resolution model now provides extra types:
metanorma/cipm-resolutions@f52ffc8

ConsiderationType:

   accepts
   observing
   referring
   acting
   empowers
   reaffirming

ActionType:

   declares
   elects
   authorizes
   charges
   states
   remarks
   judges
   sanctions
   abrogates
   empowers

Please refer to the changes in the following commits:

Update fetching location of "CIPM Recommendations"

From Janet Miles of the BIPM:

Most (if not all) of the CIPM Recommendations have been entered into the website, but unfortunately the problems with their display have not yet been resolved (for example, you will see "Resolution" even where it should be "Recommendation").

i.e. These are Recommendations, not Resolutions.

They should all be available here: https://www.bipm.org/en/committees/ci/cipm/recommendations

Data locations:

e.g.
The 1948 Resolution at https://www.bipm.org/en/committees/ci/cipm/42-1948/resolution-
The 1946 Resolutions at:

All the links include "resolution" regardless of whether the text was a "resolution" or "recommendation".
In the software we have to differentiate.

It might however be helpful to the user to retain the page information (e.g. CIPM, 1948, p88).

We need to retain the page information.

We also need to provide this URL in the data structure.

Provide details of the reference, not only the URL

When we see this: https://www.bipm.org/en/committees/cg/cgpm/26-2018/resolution-1

image

There are actually 3 types of information provided:

  • Title of the reference: "Proceedings of the 26th CGPM (2018), 2019"
  • Page number of the reference: "p472"
  • URL of the reference: https://www.bipm.org/documents/20126/17314988/CGPM26.pdf/9db96c32-a986-e32a-09f9-3ed7e6c77cf7?version=1.5&t=1644249673647&download=true#page=472

We want to add such information in structured format in the bipm-data-outcomes files:
https://github.com/metanorma/bipm-data-outcomes/blob/d625c7216260970de3904e4979c12f0b34679e3c/cgpm/meetings-en/meeting-01.yml#L8-L14

Refactor gem to utilize the Edoxen gem

Currently the bipm-data-importer implements an object model for BIPM outcomes. The BIPM outcomes are actually based on the Metanorma resolutions model, which is now renamed to "Edoxen".

Once the new Edoxen gem is implemented, we can refactor the bipm-data-importer to use / extend from Edoxen directly. This allows us to better manage resolutions and outcomes from different bodies.

Depends on:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.