metanorma / pubid-iso

Implementation of ISO pubid
BSD 2-Clause "Simplified" License
1 stars 0 forks source link

Implement typed stages #139

Closed mico closed 1 year ago

mico commented 1 year ago

We need to be able to store typed stages like "DTR" (DTS, DPAS?) in identifier's object. And provide "fuzzy" harmonized stages related to this "typed stage" when there are several options available.

From Skype chat with @ronaldtse:

Maybe instead of a new class PossibleHarmonizedStages, you can change HarmonizedStage into a "fuzzy" specification, e.g. HarmonizedStage.new(:fuzzy, "10.00", "20.00"...) ?

For a fuzzy HarmonizedStage that goes across stages (e.g. "10.99", "20.00") will be undetermined. But if the HarmonizedStage is "10.xx" then we have the stage code as 10, just no substage.

So you are right... fuzzy HarmonizedStage should not allow generating URNs

So there are only 3 statuses possible:

  • published (i.e. don't specify status at all)
  • draft (i.e. stages from 00.xx to 50.xx)
  • cancelled (i.e. stages from 00.98, 10.98, 20.98, 30.98, 40.98, 50.98, 95.99) so i guess if a HarmonizedStage code is 00.xx to 50.xx, we can use the draft value instead of stage-xx.yy.

"DTR" is the type-stage-abbreviation of "TR" in stage 40 to 50. Notice that stage code 30 is a "CD TR".

Perhaps this is useful as a clarification of the type-stage definitions. i.e.

TECHNICAL_REPORT = {
  type_stage: {
    pwitr: {
      abbr: "PWI TR",
      name: "Preliminary Work Item Technical Report",
      harmonized_stages: [ "10.00", "10.20", ... ]
    },
    awitr: {
      abbr: "AWI TR",
      name: "Approved Work Item Technical Report",
      harmonized_stages: [ "10.99" ]
    },
    wdtr: {
      abbr: "WD TR",
      name: "Working Draft Technical Report",
      harmonized_stages: [ 20 ]
    },
    wdtr: {
      abbr: "WD TR",
      name: "Working Draft Technical Report",
      harmonized_stages: [ 20 ]
    },
    cdtr: {
      abbr: "CD TR",
      name: "Committee Draft Technical Report",
      harmonized_stages: [ 30 ]
    },
    dtr: {
      abbr: "DTR",
      name: "Draft Technical Report",
      harmonized_stages: [ 40, 50 ]
    },
    tr: {
      abbr: "TR",
      name: "Technical Report",
      harmonized_stages: [ "60" ] # etc.
  }
}

We can define this for every PubID document type.

_Originally posted by @ronaldtse in https://github.com/metanorma/pubid-iso/pull/134#discussion_r994780449_

ronaldtse commented 1 year ago

As per https://github.com/metanorma/pubid-iso/pull/134#discussion_r997664855 , we should move the TypedStage definitions inside:

So that it is easier to manage future changes of these identifiers.

mico commented 1 year ago

@ronaldtse To summarize, for URN string we provide:

ronaldtse commented 1 year ago

To clarify a bit more.

For the stage value in URNs:

https://datatracker.ietf.org/doc/html/rfc5141

status        = ( "draft" / "cancelled" ) / stage
                   ; draft     =  document that has not yet been
                   ;              accepted for publication by
                   ;              international ballot
                   ; cancelled =  document that has been deleted or
                   ;              withdrawn
stage         = "stage-" stagecode ["." iteration]
stagecode     = DIGIT DIGIT "."  DIGIT DIGIT
iteration     = "v" DIGITS
  1. If there is a specific stage specified (stage + substage codes), then we render URN using stage-xx.yy value.
  2. If there is only a stage (stage code but no substage code) specified:
    • when '00', '10', '20', '30', '40', '50', we render using the draft value
    • when '60', '90', '95', we skip the status value because we assume it is published
  3. If there is no stage specified, we assume it is a published document, and skip the status value entirely.
ronaldtse commented 1 year ago

The typed stage functionality would work like this.

For example, for a Technical Specification (TS),

  1. When I enter a PubID with stage 30, 40 or 50, I should get DTS as typed stage abbreviation.
  2. When I enter a PubID with DTS without a stage code, I should get stage 50. (maybe?)
  3. When I enter a PubID with DTS with a stage code, I should get back the stage code I entered.
ronaldtse commented 1 year ago

Ping @mico for progress

ronaldtse commented 1 year ago

Updated matrix (v1.1 with "PRF AWI"): 20221031-iso-typed-stages-v1.1.xlsx

ronaldtse commented 1 year ago

Updated "FDGuide" to "FD Guide": 20221031-iso-typed-stages-v1.2.xlsx