Project

General

Profile

Bug #2988

Custom unit does not allways create the needed <additionalMetadata> tags

Added by Callie Bowdish about 13 years ago. Updated almost 11 years ago.

Status:
Resolved
Priority:
Normal
Category:
morpho - general
Target version:
Start date:
10/29/2007
Due date:
% Done:

0%

Estimated time:
Bugzilla-Id:
2988

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>

customUnitExample.xml (3.87 KB) customUnitExample.xml gastil gastil, 01/21/2010 03:37 PM

History

#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.

#3 Updated by ben leinfelder almost 11 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

#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.

#6 Updated by Redmine Admin over 7 years ago

Original Bugzilla ID was 2988

Also available in: Atom PDF