relaton / relaton-nist

NistBib: retrieve NIST Standards for bibliographic use using the BibliographicItem model
https://www.metanorma.com
MIT License
2 stars 2 forks source link

Fix nistbib against metanorma-nist #14

Closed opoudjis closed 5 years ago

opoudjis commented 5 years ago

I've done some extensive fixes of nistbib already, but two more fixes are needed in order to get metanorma-nist rspec to work on spec/asciidoctor/base_spec.rb:292 # Asciidoctor::NIST processes default metadata

In that test, nistbib is used to fetch two bibitem descriptions of documents, using Relaton XML stubs. Two critical pieces of information in the stubs, which were preserved in prior versions of nistbib (inheriting from iso-bib-item), are now being lost:

First, the bibitem container being returned is meant to have an id parameter giving the crossreference for the standard:

<bibitem type="standard" id="SP800-53ARev.1">

That id parameter is now missing.

Second, status in NIST is modelled like in ISO, with a stage and a substage element, and optionally an iteration element. These are now being ignored; as a result, the correct

<status>
<stage>95</stage>
<substage>99</substage>
</status>

is being round-tripped as

<status>
95
99
</status>

Note that the vocabulary of stage and substage is defined in the table at the bottom of https://github.com/metanorma/metanorma-nist. In particular, the only legal substage values are "retired", "withdrawn", and "active" (which is assumed by default). The legal stage values are draft-internal, draft-wip, draft-prelim, draft-public, final, and final-review.

andrew2net commented 5 years ago

@opoudjis I don't the stage and substage table. If the status is final does it mean stage is 60?

opoudjis commented 5 years ago

Yes. The table is at the bottom of the readme, https://github.com/metanorma/metanorma-nist/blob/master/README.adoc#document-status, and the corresponding ISO stages are mapped there

I'm not sure we should be using the ISO codes for stages any more, but that's a later discussion.

ronaldtse commented 5 years ago

It’ll be better to use stage names than ISO stage codes?

opoudjis commented 5 years ago

... And having pulled your code, I see that you're using older stage codes, despite me explicitly saying what the codes are above.

There is no such thing any more as draft-withdrawn and draft-retire. On the site, all drafts are listed as public drafts; so a retired draft is a draft-public with substage retired, and a withdrawn draft is a draft-public with substage withdrawn.

opoudjis commented 5 years ago

It’ll be better to use stage names than ISO stage codes?

The current metanorma-nist code is built all around human readable stage names in bibdata; so is every other Metanorma gem outside of ISO.

Do we really need universal ISO stage codes? Even for standards where the codes are a poor fit? And when they are meaningless to the internal processes or nomenclature of cited standards? I don't think so. At most, we can supplement stages and substages with ISO numbers as an interoperability equivalent, though there aren't actually that many circumstances that would be useful anyway.

opoudjis commented 5 years ago

I now think that ISO stages should not be coded in relaton at all; mappings of native stages to ISO should instead be offered as a utility function in the relaton gems.