Closed andrew2net closed 6 months ago
@andrew2net
0> Identifier.parse('ISO/IEC 23008-1:2023/WD Amd 1').year
=> nil
0> Identifier.parse('ISO/IEC 23008-1:2023/WD Amd 1').base.year
=> 2023
0> Identifier.parse('ISO/IEC 23008-1:2023/WD Amd 1').base.exclude(:year).to_s
=> "ISO/IEC 23008-1"
I had no idea about cases like this, so for now only the way to deal with that:
0> id = Identifier.parse('ISO/IEC 23008-1:2023/WD Amd 1')
0> id.base = id.base.exclude(:year)
0> id.to_s
=> "ISO/IEC 23008-1/WD Amd 1"
This is indeed tricky, but the most tricky part is that IDs like 'ISO/IEC 23008-1/WD Amd 1'
that do not contain a base year shouldn't be used...
This is indeed tricky, but the most tricky part is that IDs like
'ISO/IEC 23008-1/WD Amd 1'
that do not contain a base year shouldn't be used...
@ronaldtse Do you mean we should raise an error?
@mico no, we know that these references exist, so we must support them.
@mico maybe we need another name for amendment year? For example use pubid.exclude(:year, :amd_year)
to exclude both years.
The thing is a supplement is not only "amendment" but also "corrigenda" and "supplement". Unless we pass on options to the base?
Also... why do we want to explicitly exclude year in the rendering?
I understand the need to compare after exclude... I guess there is a need.
How about something like:
pubid.exclude(:year, base: [:year])
I understand the need to compare after exclude... I guess there is a need.
How about something like:
pubid.exclude(:year, base: [:year])
@ronaldtse What about something like:
pubid.exclude(:year, apply_to_base: true)
So it will exclude year for supplement and base as well.
I’m not sure what you can “exclude” though, so I don’t know if everything you can exclude at the Supplement level can also apply to the base?
pubid.exclude(:year, base: [:year])
pubid.exclude(:year, apply_to_base: true)
@ronaldtse @mico for me both approaches look ok if we don't need to check whether pubid has base document or not. But, I'm not sure that we won't need to control base document year and amd document year separately later.