metanorma / metanorma-iso

Metanorma processor for ISO standards
BSD 2-Clause "Simplified" License
13 stars 5 forks source link

Citations: cross-referencing to an "ISBN auto-fetched" document uses "ISBN number" for reference #1116

Closed ronaldtse closed 5 months ago

ronaldtse commented 6 months ago
Screenshot 2024-02-28 at 3 22 14 PM

Bibliography:

* [[[snow_crash,ISBN 9780553562613]]]

On the other hand, this works:

* [[[snow_crash,(1)ISBN 9780553562613]]]
Screenshot 2024-02-28 at 4 04 23 PM
ronaldtse commented 6 months ago

Either we change this behavior or document this on metanorma.org.

opoudjis commented 5 months ago

This behaviour does indeed need to change. I suspect I have already fixed this in the relaton-render refactor, which excludes ISBN as an "authoritative" (i.e. citeable) document identifier; if not, I need to ensure it does. The point of the refactor was to make relaton-render the single source of truth for authoritative docidentifiers.

ronaldtse commented 5 months ago

This happens with DOI identifiers as well, with the DOI identifier appearing as as reference tag in inline citations.

opoudjis commented 5 months ago

The last refactor addressed the fact that the citation docidentifier was being calculated in two places, isodoc biblio-tags and relaton-render; it removed the first in favour of the second.

But the citation docidentifier is calculated a third time, in standoc, providing the value of eref/@citeas. The third time it is calculated has a more naive ruleset, which is allowing ISBN and DOI to be treated as citation identifiers.

That is bad design, and citeas is not truly semantic information at all; I am going to get rid of citeas in Semantic XML, and populate it in Presentation XML, when the definitive identifier for each reference is already calculated.

opoudjis commented 5 months ago

I won't get rid of it in standoc, because it is useful for validation (and the alternative would become spaghetti); but I will overwrite it in isodoc.

opoudjis commented 5 months ago
== Scope

This is ISBN <<snow_crash>>

This is DOI <<handbook>>

[bibliography]
== Bibliography

* [[[snow_crash,ISBN 9780553562613]]]
* [[[handbook,doi:10.1201/9781420049367.ch4]]]

now renders as:

<title depth="1">1<tab/>Scope</title>
<p id="_1a31ee62-be2f-e4f0-ecb7-7b6cd630f8a3">This is ISBN <xref type="inline" target="snow_crash">[2]</xref></p>

<p id="_46a35f9b-c586-b4ce-3a72-e1c2e47cdadc">This is DOI <xref type="inline" target="handbook">[1]</xref></p>
</clause>

(The order is reversed, because under ISO, the DOI reference Polyhydroxyalkanoates comes before the ISBN reference Snow Crash.)