Code Monkey home page Code Monkey logo

pubid-bsi's Introduction

BSI publication identifiers ("BSI PubID")

Purpose

This gem implements a mechanism to parse and utilize BSI publication identifiers.

Use cases to support

  1. generate updated PubID

Usage

Identifier creation

Basic usage of the pubid-bsi gem starts with the Identifier#create method.

require "pubid-bsi"

pubid = Pubid::Bsi::Identifier.create(number: 1234, part: 1, year: 1999)
pubid.to_s

=> "BS 1234-1:1999"

With document type

pubid = Pubid::Bsi::Identifier.create(type: :pas, number: 1234)
pubid.to_s

=> "PAS 1234"

Identifier’s class and type

Identifier#parse resolves a parsed identifier according to the type.

Pubid::Iso::Identifier.parse("PAS 1234").class
# => Pubid::Bsi::Identifier::PubliclyAvailableSpecification
Pubid::Iso::Identifier.parse("PAS 1234").type
# => {:key=>:pas, :title=>"Publicly Available Specification"}
Pubid::Iso::Identifier.parse("BS 1234").class
# => Pubid::Bsi::Identifier::BritishStandard
Pubid::Iso::Identifier.parse("BS 1234").type
# => {:key=>:bs, :title=>"British Standard"}

pubid-bsi's People

Contributors

camobap avatar mico avatar opoudjis avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pubid-bsi's Issues

Parse identifiers with Amendment

BS 7273-4:2015+A1:2021 means this document is BS 7273-4:2015 incorporating the Amendment A1 published in 2021.

BS 4592-0:2006+A1:2012
BS 1192:2007+A2:2016
BS 4142:2014+A1:2019
BS 5228-1:2009+A1:2014
BS 7273-4:2015+A1:2021
BS 8500-1:2015+A2:2019
BS 8500-2:2015+A2:2019
PAS 5678:2005+A1:2009
PAS 5678-2:2005+A1:2009
PD 5500:2021+A2:2022

This task depends on:

Parse PAS identifiers

PAS stands for "Publicly Available Specification".

PAS 0
PAS 0:2012
PAS 0:2022
PAS 1192-2:2014
PAS 1192-3:2014
PAS 1192-6:2018
PAS 1878
PAS 1879
PAS 2035
PAS 2060
PAS 24000
PAS 24:2012
PAS 377:2023
PAS 440
PAS 6463
PAS 7000
PAS 7050
PAS 7100
PAS 7340
PAS 7341
PAS 808
PAS 8671:2022
PAS 8672:2022
PAS 8673:2022
PAS 91:2013
PAS 9980
PAS 99:2012

Gem is not accepting expert_commentary parameter

The pubid-bsi gem that has been released is not accepting expert_commentary as a parameter

The code on this repository does, but since there is no indication of release or even release tag on this repository, I have no way of seeing on the repository which version of the code has been released as the current gem. The released gem, on inspection, is not parsing that parameter.

Please consult @CAMOBAP on how Ribose gems are released through github. Release tags must be used, so we can tell what code is being used in what version of the gem.

Please release current version of pubid-bsi, so that I can continue with https://github.com/metanorma/metanorma-bsi/issues/385

Parse and construct BSI identifiers: BS

BS stands for "British Standard"

BS 0
BS 11000-2
BS 11200:2014
BS 1234:2019
BS 1992-4:2014
BS 202000:2020
BS 20400
BS 6004:2012
BS 7000-2
BS 7000-4
BS 7121-3:2017
BS 7593.2019
BS 7671:2018 
BS 7858
BS 7903:2020
BS 7913:2013
BS 8004:2015
BS 8233:2014
BS 8536-2:2016
BS 8580-1:2019
BS 8654:2015
BS 8887-1:2006
BS 8887-220:2010
BS 8887:2009
BS 9992
BS 9999

Parse ISO and IEC identifiers

BSI also re-publishes documents from ISO, IEC and ISO/IEC:

IEC 62304
IEC 62366-1
ISO 10667-1
ISO 10667-2
ISO 11607-1
ISO 11607-2
ISO 37101:2016
ISO/IEC 29151

Parse PDF identifiers

PD 5500:2018+A3:2020 PDF
PD 5500:2015+A3:2017 PDF
PD 5500:2021+A2:2022 PDF
BS 8501:2002 PDF

Parse translations

PAS 9017:2020+C1 SPANISH TRANSLATION
BS 25999-1:2006 (German)
BS 25999-1:2006 (French)
BS 25999-2:2007 (French)
PAS 402:2009 (Welsh)
PAS 78:2006 WELSH TRANSLATION
PAS 99:2006 (Italian Translation)
PAS 99:2006 (Spanish Translation)
BS 25999-2:2007 (German)
BS ISO/IEC 17799:2005 (French version)
PAS 1018:2017 (Cantonese)
PAS 186:2020 (Chinese)
PAS 13:2017 (Italian)

Parse adoptions: ISO / IEC

BSI often adopts documents from ISO / IEC:

PD IEC/TR 80002-3:2014
PD ISO/TR 44000
PD ISO/PAS 45005:2020
DD ISO/TS 128-71:2010
BS ISO 22382:2018
BS ISO 30042
BS ISO 44001
BS ISO 44002
BS ISO 44003
BS ISO/IEC 30134-1:2016

Adoptions need to respect year in parameter

The current implementation of bsi is assuming, in the case of the adopted parameter, that the year will be supplied in the adopted identifier value. It must not: the year in the identifier call overrides it, and we have documents where the adopted identifier is not given with a year.

So:

Pubid::Bsi::Identifier.create(number: 639, adopted: Pubid::Cen::Identifier.parse("EN ISO 639:2012")).to_s == 
"BS EN ISO 639:2012"

but:

Pubid::Bsi::Identifier.create(number: 639, year: "2013", adopted: Pubid::Cen::Identifier.parse("EN ISO 639:2012")).to_s ==
   "BS EN ISO 639:2013" # (currently is "BS EN ISO 639:2012")
Pubid::Bsi::Identifier.create(number: 639, year: "2013", adopted: Pubid::Cen::Identifier.parse("EN ISO 639")).to_s == 
  "BS EN ISO 639:2013" # (currently is "BS EN ISO 639")

Parse adoptions: EN / CEN identifiers

BSI often adopts EN / CEN standards from CEN/CENELEC . EN standards for European Norm ("standard").

This depends on:

DD CEN/TS 1992-4-2:2009
BS CEN/TR 16663:2014
BS CEN/TR 16793:2016
BS CEN/TS 17062:2017
BS CEN/TS 1793-5:2003
BS EN 12101-3
BS EN 12320:2012
BS EN 12397:2017
BS EN 12973
BS EN 13201-2:2015
BS EN 1359:2017
BS EN 15154-5:2019
BS EN 16341
BS EN 1992-4:2018
BS EN 60598-1:2015
BS EN 81-72
BS EN 1177:2018
PD CEN/TS 17062:2019
PD CEN/TR 10261:2018
PD CEN/TR 12831-2:2017
PD CEN/TR 12831-4:2017
PD CEN/TS 16415:2013
PD CEN/TR 17797:2022
PD CEN/TR 16411 

Parse documents with Amendments or Corrigenda included

BS EN 55014-1:2017+A11:2020
BS EN IEC 60238:2018+A11:2021
BS EN IEC 60947-5-2:2020+A11:2022
BS EN ISO 11203:2009+A1:2020
BS EN ISO 80601-2-56:2017+A1:2020
BS EN 60335-2-35:2016+A2:2021
BS EN 13480-5:2017+A2:2021
BS EN 60335-2-12:2003+A2:2019
BS EN 14915:2013+A2:2020
PD 5500:2018+A3:2020
PD 5500:2015+A3:2017
PD IEC TS 63134:2020+A1:2022
PAS 3002:2018+C1:2018
PAS 2035/2030:2019+A1:2022
PAS 4444:2020+A1:2021
PAS 24:2007+A2:2011
PD IEC TR 60919-3:2009+A2:2021
PD CISPR TR 16-4-5:2006+A2:2021
PAS 2035:2019+C2:2021
PAS 2030:2019+C2:2021

Parse "Expert Commentary" identifiers

BSI publishes "Expert Commentary" documents for certain standards, they use this pattern:

{base identifier} ExComm

e.g.

BS 7273-4:2015+A1:2021 ExComm
BS EN ISO 13485:2016+A11:2021 ExComm
BS EN 55011:2016+A2:2021 ExComm
BS EN 61000-3-3:2013+A2:2021 ExComm
BS 5250:2021 ExComm
BS EN ISO 2692:2021 ExComm
BS EN ISO 22301:2019 ExComm
BS EN IEC 61439-2:2021 ExComm
BS 60080:2020 ExComm
BS EN IEC 62115:2020+A11:2020 ExComm
BS 1722-2:2020 ExComm
BS EN IEC 60947-1:2021 ExComm
BS EN IEC 61000-6-3:2021 ExComm
BS EN ISO/IEC 80079‑34:2020 ExComm
BS 10008-1:2020 ExComm
BS EN IEC 62115:2020+A11:2020 ExComm

Fails to parse publication identifiers of "combined documents" ("PAS 2035/2030:2019")

BSI has documents like PAS 2035/2030:2019+A1:2022 and this gem fails to parse their identifiers:

Pubid::Bsi::Identifier.parse "PAS 2035/2030:2019+A1:2022"
Failed to match sequence (stage:'Fpr'? 'WD/'? (type:GUIDE_PREFIX SPACE)? (stage:STAGE SPACE)? (stage:TYPED_STAGE SPACE)? (ORIGINATOR (SPACE / '/'))? (TC_DOCUMENT_BODY / STD_DOCUMENT_BODY / DIR_DOCUMENT_BODY (' + ' dir_joint_document:(ORIGINATOR SPACE DIR_DOCUMENT_BODY))?)) at line 1 char 1.
cause: Failed to match sequence (stage:'Fpr'? 'WD/'? (type:GUIDE_PREFIX SPACE)? (stage:STAGE SPACE)? (stage:TYPED_STAGE SPACE)? (ORIGINATOR (SPACE / '/'))? (TC_DOCUMENT_BODY / STD_DOCUMENT_BODY / DIR_DOCUMENT_BODY (' + ' dir_joint_document:(ORIGINATOR SPACE DIR_DOCUMENT_BODY))?)) at line 1 char 1.
`- Expected one of [TC_DOCUMENT_BODY, STD_DOCUMENT_BODY, DIR_DOCUMENT_BODY (' + ' dir_joint_document:(ORIGINATOR SPACE DIR_DOCUMENT_BODY))?] at line 1 char 1.
   |- Failed to match sequence ((tctype:TCTYPE '/'?){0, } SPACE tcnumber:DIGITS ('/' ((sctype:SCTYPE SPACE scnumber:DIGITS '/')? wgtype:WGTYPE SPACE wgnumber:DIGITS / sctype:SCTYPE (SPACE / '/' wgtype:WGTYPE SPACE) scnumber:DIGITS))? SPACE 'N' SPACE? number:DIGITS) at line 1 char 1.
   |  `- Expected " ", but got "P" at line 1 char 1.
   |- Failed to match sequence ((TYPE / stage:STAGE)? SPACE? ((stage:STAGE / stage:TYPED_STAGE / TYPE) SPACE)? number:DIGITS ('|' joint_document:(publisher:'IDF' SPACE number:DIGITS))? PART? ITERATION? (SPACE? (':' / '-') YEAR)? SUPPLEMENT? ADDENDUM? EDITION? LANGUAGE?) at line 1 char 9.
   |  `- Extra input after last repetition at line 1 char 9.
   |     `- Failed to match sequence ('(' language:(([a-z]{1, } ','? / ('E' / 'F' / 'A' / 'R') '/'?){0, }) ')') at line 1 char 9.
   |        `- Expected "(", but got "/" at line 1 char 9.
   `- Failed to match sequence (DIR_DOCUMENT_BODY (' + ' dir_joint_document:(ORIGINATOR SPACE DIR_DOCUMENT_BODY))?) at line 1 char 1.
      `- Extra input after last repetition at line 1 char 1.
         `- Failed to match sequence (' + ' dir_joint_document:(ORIGINATOR SPACE DIR_DOCUMENT_BODY)) at line 1 char 1.
            `- Expected " + ", but got "PAS" at line 1 char 1.

Blocks this task relaton/relaton-bsi#24

Parse Flex identifiers

Flex is a new type of document published by BSI, which is like a PAS but with faster production.

The identifier pattern has two differences:

  1. Can include a version (edition) number
  2. Can provide the month
BSI Flex 0 v2.0:2022-08
BSI Flex 1889 v1.0:2022-07
BSI Flex 8670 v3.0:2021-04
Flex 0:2022
Flex 1889
Flex 1890
Flex 5555
Flex 8670 v3.0:2021-04
Flex 8670:2021
Flex 8670:2021-04

Parse "Tracked Changes" identifiers

BS EN ISO 8062-3:2023-TC
BS ISO 22393:2023 - TC
BS EN 1811:2023 - TC
BS EN IEC 62149-4:2023 - TC
PAS 2031:2019 - TC
PAS 96:2017 - TC
PD IEC TS 63074:2023 - TC
PD ISO/TS 17996:2023 - TC
PD IEC TR 62627-01:2023 - TC
PD CEN/TR 17419-2:2023 - TC

Parse National Annexes

NA+A2:2022 to BS EN 1997-1:2004+A1:2013
NA+A2:18 to BS EN 1991-1-3:2003+A1:2015
NA to BS EN 1996-1-1:2005+A1:2012
NA to BS EN 1993-3-1:2006
NA to BS EN 1997-2:2007
NA to BS EN 1991-4:2006
NA to BS EN 1993-6:2007
NA+A1:2012 to BS EN 1993-5:2007
NA+A1:2014 to BS EN 1993-1-1:2005+A1:14
NA+A1:2014 to BSEN1991-1-7:2006+A1:2014
NA to BS EN 1999-1-2:2007
NA+A1:15 to BS EN 1993-1-4:2006+A1:2015

Parse PD identifiers

PD standards for "Published Document", which is the BSI equivalent of an ISO TR or TS.

PD 19650-0:2019
PD 6688-2:2011
PD 7974-5:2014
PD 8101:2014

Parse DD identifiers

DD standard for "Draft Document", this is a kind of BSI document. They were last published in 2012.

DD 240
DD 240-1
DD 240-1:1997
DD 8458
DD 8489-1:2011

Parse 2-level adoptions: e.g. "EN ISO", "CEN ISO"

These are 2-level adoptions:

  • ISO/IEC publishes a standard
  • EN or CEN adopts the ISO/IEC standard
  • BS or PD or DD adopts the EN/CEN standard
BS EN ISO 13485:2012
BS EN ISO 13485:2016
BS EN ISO 13485:2016+A11:2021
BS EN ISO 14971:2012
BS EN ISO 20607:2019
BS EN ISO 56000
BS EN ISO 56002
BS EN ISO 56003
BS EN ISO 898-1:2013
BS EN IEC 62305-4
BS EN IEC 62368-1:2020+A11:2020 
PD CEN ISO/TR 20173:2018
BS EN ISO/IEC 17025:2017
BS EN ISO/IEC 80079-34:2020 ED2

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.