Bug #2988
closedCustom unit does not allways create the needed <additionalMetadata> tags
0%
Description
An example of a data package that had to be edited in a text editor is the following:
http://knb.ecoinformatics.org/knb/metacat?action=read&qformat=knb&docid=gss1.22&displaymodule=entity&entitytype=dataTable&entityindex=1
Here is part of the error reported in the stderr.log
<error>
Error processing keyrefs: //unit/customUnit : Error in xml document. This EML instance is invalid because referenced id partsPerBillion does not exist in the given keys.
</error>
There is a partsPerBillion, and a partsPerMillion custom unit that the user created using Morpho but when the dp was saved the necessary <additionalMetadata> tags were not created. Then we had to add the following, using a text editor, so that the data package would save up to the network.
<additionalMetadata><unitList><unit id="partsPerMillion" multiplerToSI=" " name="partsPerMillion" parentSI="molesPerCubicMeter" unitType="amountOfSubstanceConcentration"><description>partsPerMillion</description>
</unit>
</unitList>
</additionalMetadata>
<additionalMetadata><unitList><unit id="partsPerBillion" multiplerToSI=" " name="partsPerBillion" parentSI="molesPerCubicMeter" unitType="amountOfSubstanceConcentration"><description>partsPerMillion</description>
</unit>
</unitList>
</additionalMetadata>
Files
Updated by Callie Bowdish over 16 years ago
Here is another error that looks similar that someone emailed me today. She will hopefully be sending me the eml and the stderr.log
<error> error processing keyrefs //unit/customUnit: Error in XML document. This EML instance is invalid because referenced id Position does not exist in the given keys. </error>
Please note I do not know if she is working with an earlier version of Morpho. Some of the South African people have not updated yet. I know the current version of Morpho creates an extra customUnit in the additionalMetada section sometimes.
Updated by ben leinfelder almost 15 years ago
a few notes:
-this was an EML 2.0.1 document
-the latest codebase creates EML 2.1.0 that has a slightly different additionalMetadata structure
-trying this with the latest Morpho codebase did not result in error
-there have been quite a few changes since 2007/2008 to this area of the code
Without knowing exactly how the custom unit was defined (I've made some best guesses about that) i don't think i can recreate the error at this point.
If this is a recurring bug, we should reopen.
Updated by ben leinfelder almost 15 years ago
figured out how to recreate this error:
-define a custom unit in one EML file
-save and close that file
-open another EML file and use the newly defined custom unit.
-additionalMetadata will not be saved for the second EML file
Updated by ben leinfelder almost 15 years ago
now Morpho inserts the appropriate additionalMetadata for any custom units that are used in the datapackage.
Note: custom units are loaded when a DP is opened and are available for use in other datapackages throughout that same session in Morpho. If you close Morpho completely, then the custom units that were previously loaded will not be present (until you open a datackage that uses custom units).
Note 2: if you have previously used a custom unit but then decide not to use it, there is no mechanism to remove the definition from the additionalMetadata stored in the datapackage.