Custom unit does not allways create the needed <additionalMetadata> tags
An example of a data package that had to be edited in a text editor is the following:
Here is part of the error reported in the stderr.log
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.
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>
<additionalMetadata><unitList><unit id="partsPerBillion" multiplerToSI=" " name="partsPerBillion" parentSI="molesPerCubicMeter" unitType="amountOfSubstanceConcentration"><description>partsPerMillion</description>
#1 Updated by Callie Bowdish over 12 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.
#2 Updated by ben leinfelder almost 11 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.
#4 Updated by ben leinfelder almost 11 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.