PASTAplus / DataPortal

EDI Data Portal
3 stars 3 forks source link

Inconsistent rendering of the "For more information" section of the "Full Metadata" page #89

Open clnsmth opened 1 year ago

clnsmth commented 1 year ago

A data package's "Full Metadata" page includes the "For more information:" section for some packages but not others. For example, see the rendered pages of knb-lter-knz.3.15 and knb-lter-knz.91.5, each of which contains the EML <distribution> elements used to populate this information.

EML of knb-lter-knz.3.15:

<distribution>
  <online>
    <url function="information">http://lter.konza.ksu.edu/content/ana01-weekly-seasonal-and-annual-measurement-precipitation-volume-and-chemistry-collected</url>
  </online>
</distribution>
<distribution id="10.6073/pasta/295644787ee8a1c00edd6f48dde75c4e" scope="system" system="https://pasta.edirepository.org">
  <online>
    <url function="information">https://doi.org/10.6073/pasta/295644787ee8a1c00edd6f48dde75c4e</url>
  </online>
</distribution>

and knb-lter-knz.91.5:

<distribution>
  <online>
    <url function="information">http://lter.konza.ksu.edu/content/vir01-effects-invertebate-and-vertebrate-herbivory-tallgrass-prairie-plant-community</url>
  </online>
</distribution>

This behavioral difference correlates with the presence/absence of the <distribution> element's id attribute. When present, the "For more information:" block is rendered, when absent it is not. The code point driving this behavior appears to be: https://github.com/PASTAplus/DataPortal/blob/c60aa7eb6acdad2445bd80db6cee20339ae8e829/WebRoot/WEB-INF/xsl/eml-2.xsl#L1997

A potential solution might be to remove the test for the id attribute?

servilla commented 1 year ago

The difference in rendering is correctly analyzed by @clnsmth. The distribution element's lack of an @id attribute precludes its rendering.

The root cause of the difference, however, is another matter: apparently, the initial registration of the DOI for knb-lter-knz.91.5 did not occur synchronously with the update of the data package (as it did with knb-lter-knz.3.15); because the Level-1-EML.xml becomes immutable once published, the EML itself will not have an alternateIdentifier or the dataset-level distribution containing the data package DOI (the DOI was subsequently registered about 2 hours post update).

As noted, the lack of a dataset distribution element containing the DOI (and the corresponding id attribute) prevented the "For more information:" block from rendering. EDI policy must decide if any and all dataset-level distribution elements be displayed in the full metadata rendering or only those with an EDI-registered DOI. Regardless, this conditional

      <!-- the dataset-level distribution tag. for LTER, it should be 
           function=information. the link to the data entity itself 
           will be in the entity's tree.  -->
      <xsl:if test="distribution/@id">
        <tr>
          <td colspan="2">
            <table class="subGroup onehundred_percent">
              <tr>
                <td>
                  <table class="{$tabledefaultStyle}">
                    <th colspan="2">For more information:</th>
                    <xsl:for-each select="distribution">
                      <tr>
                        <td class="{$firstColStyle}"><xsl:text>Visit: </xsl:text></td>
                        <td class="{$secondColStyle}">
                          <a>
                            <xsl:attribute name="class">dataseteml</xsl:attribute>
                            <xsl:attribute name="href"><xsl:value-of select="online/url"/>
                            </xsl:attribute><xsl:value-of select="online/url"/>
                          </a>
                        </td>
                      </tr>
                    </xsl:for-each>
                  </table>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </xsl:if>

within the eml-2.xsl will require modification.