[greenstone-devel] Bug: metadata.xml not handled correctly by import

From Mike Blyth
DateSat, 28 Feb 2004 10:50:03 +0100
Subject [greenstone-devel] Bug: metadata.xml not handled correctly by import
Program: import.pl 2.41; GLI 2.41
 
Problem: I used GLI to apply metadata labels to files in the import directory. When the files were imported, however, each one had only one of the labels that I had applied.
 
Reason:
When identical filename specifications are repeated in metadata.xml, only the last one is applied. This would be less of a problem except that GLI does repeat the fileset section once for each metadata label being applied to a file. Thus all but the last one (in an arbitrary sequence) are lost.
 
E.g., GLI will create something like this (in metadata.xml):
 
<FileSet>
  <FileName>File.pdf</FileName>
    <Description>
       <Metadata name="dls.Organization">USAID</Metadata>
    </Description>
  </FileSet>
<FileSet>
  <FileName>File.pdf</FileName>
  <Description>
    <Metadata name="dc.Date">2004</Metadata>
  </Description>
</FileSet>
 
This results in only Date being inserted as metadata, and not organization. If the second file set description is
 
  <Description>
    <Metadata name="dc.Date">2004</Metadata>
    <Metadata name="dls.Organization">USAID</Metadata>
  </Description>
 
instead, both Date and Organization are included. Thus it appears that the first FileSet is being ignored or overwritten or something. If the filename specifications are different but both match the file, then both are applied. E.g. if the first FileName is "Fil.*" and the second is "File.*", then both are applied. But when the filters are the same, only the last one is applied.
 
--Mike Blyth
ECWA Evangel Hospital
Jos, Nigeria