metanorma / pubid-iso

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

Simplify assignment of "edition" to a pubid (base or supplements) #157

Closed andrew2net closed 1 year ago

andrew2net commented 1 year ago

With the previous version of pubid-iso we set an edition using just pubid.edition = "2". With the last v 0.2.2 we have to check if there is a base document pubid.base then an edition should be set for the base document pubid.base.edition = "2". I think we should implement this logic in this gem, so we can use just pubid.edition = "2" in both cases.

@mico the last update changed the usage of this gem and required updating the relaton-iso gem. I remind you that in such a case we need to increase minor version number. I.e. the new pubid-iso version should be 0.3.0.

mico commented 1 year ago

@ronaldtse could base identifier and amendment or corrigendum have separate edition numbers?

ronaldtse commented 1 year ago

Yes. Base identifier is really an independent, separate PubID.

andrew2net commented 1 year ago

Yes. Base identifier is really an independent, separate PubID.

How many IDs can pubid contain? 2, 3?

If pubid can contain more than 2 IDs shouldn't we have pubid[N] method to have access to the IDs? For example, use pubid[0] to get the main ID, pubid[1] to get an additional ID, etc.

Could we have pubid.edition= method always set an edition for the main ID? And the method like pubid[N].edition= for additional IDs?

ronaldtse commented 1 year ago

So far we have seen 3 layers. Cor of an Amd of an IS. I imagine that we can access with:

“pubid.base.base”?

andrew2net commented 1 year ago

So far we have seen 3 layers. Cor of an Amd of an IS. I imagine that we can access with:

“pubid.base.base”?

I'm trying to tell you that there is some inconsistency in accessing a base ID. In 1 layer case, we should reference the base ID with just pubid. With 2 layers case, we should use pubid.base. With 3 layers pubid.base.base. So every time we need to set an edition for a base document we have to check if pubid.base and pubid.base.base exist. I think a reference to the base document shouldn't depend on the number of layers.

ronaldtse commented 1 year ago

Thanks @andrew2net for clarifying.

I agree that the layering concept can be challenging to use.

This actually involves two questions:

  1. How often do we set edition of the base document? In what circumstances?
  2. Interestingly, Amd and Cor do not support "editions" because the "number" (Amd 1) is already the edition number. They however support "version".

e.g. RFC 5141:

  urn:iso:std:iso:9999:-1:ed-2:en:amd:1:cor:1
  refers to Corrigendum 1 to Amendment 1 to the 2nd edition of ISO
  9999-1, in English

And

  urn:iso:std:iso:9999:-1:ed-1:v1-
  amd1.v1:en,fr:amd:2:v2:en:clause:3.1,a.2-b.9 (isoversion scheme)
  refers to (sub)clauses 3.1 and A.2 to B.9 in the corrected version
  of Amendment 2, in English, which amends the document comprising
  the 1st version of edition 1 of ISO 9999-1 incorporating the 1st
  version of Amendment 1, in English/French (bilingual document)

Which means this also works:

Could we have pubid.edition= method always set an edition for the main ID?

Yes, because "edition" is always for the base ID (Amd/Cor do not have "edition", only "version").

We can alias pubid.edition= to pubid[0].edition=.

And the method like pubid[N].edition= for additional IDs?

I agree that a new pubid[N] method is a good idea, which means that:

ronaldtse commented 1 year ago

@ronaldtse could base identifier and amendment or corrigendum have separate edition numbers?

@mico I realize I made a mistake. The answer is NO, because:

So in a pubid there is only one "edition".

mico commented 1 year ago

@ronaldtse could base identifier and amendment or corrigendum have separate edition numbers?

@mico I realize I made a mistake. The answer is NO, because:

  • a base pubid can have "edition" and "version"
  • a supplement pubid can only have "version" (the "edition" is actually the "number", e.g. Amd 1, Cor 1)

So in a pubid there is only one "edition".

Idea of moving supplements (amendment and corrigendum) from separate classes to Identifier class was to represent supplement as a main identifier, right? In this case, Is it not confusing to have access to base identifier "edition" through pubid.edition which actually points to supplement?

Maybe we can add an accessor, like pubid.primary or pubid.root or pubid.main that always points to the main identifier even if it points to itself (no identifiers assigned to base).

ronaldtse commented 1 year ago

Idea of moving supplements (amendment and corrigendum) from separate classes to Identifier class was to represent supplement as a main identifier, right?

Yes.

In this case, Is it not confusing to have access to base identifier "edition" through pubid.edition which actually points to supplement?

Yes I personally think it is confusing, and shouldn't be done.

Maybe we can add an accessor, like pubid.primary or pubid.root or pubid.main that always points to the main identifier even if it points to itself (no identifiers assigned to base).

I agree! Let's call it root: