metanorma / metanorma-iso

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

ISO 19135: wrong relationship between requirements #861

Closed Intelligent2013 closed 1 year ago

Intelligent2013 commented 1 year ago

Source issue: https://github.com/metanorma/metanorma-iso/issues/855

Source document: https://github.com/metanorma/iso-19135/tree/main/sources/iso-19135-2021

I update mnconvert for requirements conversion from semantic Metanorma XML to NISO STS XML tables, and found a difference between data in my resulted XML and Metanorma presentation XML.

From sections\data\11-governance-establish-rc.yaml - Requirements of the establishment process 'contains' Consider scope:

---
groups:
- scopes:
  - title: Establishment process
    name: Requirements of the establishment process.
    identifier: /req/establishment-process
    subject: establishment process
    description: |
      The establishment process creates the register with a defined purpose.
      Any entity may establish a register.
    dependencies:
    guidance:
    requirements:

    - name: Consider scope
      identifier: /req/establishment-process/consider-scope
      subject: register
      statement: In establishing the register, the purpose and scope of the register
        shall be considered.
...

Metanorma semantic XML (bundle exec metanorma -t iso -x xml document.adoc) looks correct:

<clause id="register-process-establish" inline-header="false" obligation="normative">
    <title>Establishing a register</title>
    <requirement id="rc-governance-establish-1" model="ogc" type="class">
        <title>Requirements of the establishment process.</title>
        <identifier>/req/establishment-process</identifier>
        <subject>establishment process</subject>
        <description>
            <p id="_03e05862-9568-2a57-b8d3-f8f338eb9d77">Requirements of the establishment process.</p>
        </description>
        <requirement id="_04479abc-aa9a-b33a-3f44-4fe9ebc90799" model="ogc" type="general">
            <identifier>/req/establishment-process/consider-scope</identifier>
        </requirement>
        ...
    </requirement>
    <requirement id="r-governance-establish-1-1" model="ogc">
        <title>Consider scope</title>
        <identifier>/req/establishment-process/consider-scope</identifier>
        <subject>register</subject>
        <description>
            <p id="_e1db7bc3-8119-64de-3ac2-de08343d7590">In establishing the register, the purpose and scope of the register shall be considered.</p>
        </description>
    </requirement>
...

But Metanorma presentation XML (bundle exec metanorma -t iso -x presentation document.adoc) contains: <xref target="rc-governance-establish-1">Requirements class 36: Requirements of the decommission process.</xref> (see last xref in XML fragment below), with correct target to the table with id="rc-governance-establish-1, and the text Requirements class 36: Requirements of the decommission process. instead of Requirements class 31: Requirements of the establishment process.

<clause id="register-process-establish" inline-header="false" obligation="normative">
    <title depth="2">11.2<tab/>Establishing a register</title>
    <table id="rc-governance-establish-1" class="modspec" type="recommendclass">
        <name>Table 131 — Requirements class 31: Requirements of the establishment process.</name>
        <tbody>
            <tr>
                <th>Identifier</th>
                <td>
                    <tt>/req/establishment-process</tt>
                </td>
            </tr>
            <tr>
                <th>Target type</th>
                <td>establishment process</td>
            </tr>
            <tr>
                <th>Description</th>
                <td>
                    <p id="_03e05862-9568-2a57-b8d3-f8f338eb9d77">Requirements of the establishment process.</p>
                </td>
            </tr>
            <tr>
                <th>Provisions</th>
                <td>
                    <xref target="r-governance-establish-1-1">Requirement 97: Consider scope</xref>
                    <br/>
                    <xref target="r-governance-establish-1-2">Requirement 98: Consider audience</xref>
                    <br/>
                    <xref target="r-governance-establish-1-3">Requirement 99: Consider content</xref>
                    <br/>
                    <xref target="r-governance-establish-1-4">Requirement 100: Document considerations</xref>
                </td>
            </tr>
        </tbody>
    </table>
    <table id="r-governance-establish-1-1" class="modspec" type="recommend">
        <name>Table 132 — Requirement 97: Consider scope</name>
        <tbody>
            <tr>
                <th>Identifier</th>
                <td>
                    <tt>/req/establishment-process/consider-scope</tt>
                </td>
            </tr>
            <tr>
                <th>Subject</th>
                <td>register</td>
            </tr>
            <tr>
                <th>Included in</th>
                <td>
                    <xref target="rc-governance-establish-1">Requirements class 36: Requirements of the decommission process.</xref>
                </td>
            </tr>

If we look at Requirements of the decommission in sections\data\11-governance-decommission-rc.yaml, we don't see Consider scope there:

---
groups:
- scopes:
  - title: Ddecommission process
    name: Requirements of the decommission process.
    identifier: /req/establishment-process
    subject: decommission process
    description: |
      The decommission of a register can severely impact its users. The
      decommission process consists of steps to minimize negative impact to
      register users.
    dependencies:
    guidance:
    requirements:

    - name: Consideration of the decision to decommission a register
      identifier: /req/decommissioning/considerations
...
    - name: Documentation of the decision and information relevant to the decommissioning of the register
      identifier: /req/decommissioning/document-information
...
    - name: Notification of interested parties about decommissioning of the register
      identifier: /req/decommissioning/inform-interested-parties

Is it a bug? Or did I understand the requirement's format wrong?

opoudjis commented 1 year ago

@Intelligent2013

Please look very closely at:

groups:
- scopes:
  - title: Establishment process
    name: Requirements of the establishment process.
    identifier: /req/establishment-process

then, look very closely at:

- scopes:
  - title: Ddecommission process
    name: Requirements of the decommission process.
    identifier: /req/establishment-process

What do you notice about the unique identifier attributes of these two completely distinct classes?

:-)

Yes, if the identifiers are identical, bad things will indeed happen, and have. I'll add a validation step to abort execution if this happens: it can't be allowed to.

Intelligent2013 commented 1 year ago

@opoudjis thanks, sorry, I didn't notice the identical ids...

opoudjis commented 1 year ago

The validation will be a major version of mn-requirements.