[greenstone-devel] Re: duplicate metadata in csv plug making export go badly

From Stephen De Gabrielle
DateThu, 22 Feb 2007 09:53:46 +0930
Subject [greenstone-devel] Re: duplicate metadata in csv plug making export go badly
In-Reply-To (595b9ab20702211601r961a49bk705a738347cd7d53-mail-gmail-com)
answered my own question:

To silently drop the extra metadata put these two lines at the end of
MetadataCSVPlug.pm .


my $filenametest = $extrametadata->{$this_filename} ;
return if (defined $filenametest) ;


# print STDOUT "$filenametest $filenametest " ;


$extrametadata->{$this_filename} = %csv_line_metadata;
push(@$extrametakeys, $this_filename);

}
}#next record

1;

-eof-

Cheers,

Stephen

PS it would probably be better to retain the dropped data by appending
it to the descripion but I'm still not sure how to do this without
getting a duplicate field.


On 2/22/07, Stephen De Gabrielle <spdegabrielle@gmail.com> wrote:
> Hi,
>
> I have a metadata set which has multiple records pointing to the same
> file, leading to dupliucate fields when I do an export (I assume
> import too)
>
> something like this
>
> filename, title, author
> 001.jpg, "Trees", "De Gabrielle, Stephen"
> 001.jpg, "Bushes", "De Gabrielle, Stephen"
>
> I seem to be getting duplicates of the lasr row read.
>
> Does anyone have any hints on how to detect a duplicate metadata row,
> either in CSVPlug or in imagePlug?
>
> Cheers,
>
> Stephen
>
>
> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
> <dublin_core>
> <dcvalue element="subject" qualifier="none">children; horses; women</dcvalue>
> <dcvalue element="subject" qualifier="none">children; horses; women</dcvalue>
> <dcvalue element="description" qualifier="none">Description on back
> of photo: Mortimer, Jack, Constance, Doris Bradshaw. In creek near
> telegraph station.
>
> ..FILE 795795-0003
> ..TITLE On horseback
> ..DESCRIPT Description on back of photo: Mortimer, Jack, Constance,
> Doris Bradshaw. In creek near telegraph station.
> ..DATE 20 November, 1906
> ..PHOTONO PH0797/0003
> ..CREATOR Unknown
> ..COLLECTN Boerner Archive Collection
> ..RIGHTS Unknown
> ..ACCESS 1
> ..LOCATION Alice Springs, Northern Territory
> ..SUBJECTS children; horses; women</dcvalue>
> <dcvalue element="description" qualifier="none">Description on back
> of photo: Mortimer, Jack, Constance, Doris Bradshaw. In creek near
> telegraph station.
>
> ..FILE 795795-0003
> ..TITLE On horseback
> ..DESCRIPT Description on back of photo: Mortimer, Jack, Constance,
> Doris Bradshaw. In creek near telegraph station.
> ..DATE 20 November, 1906
> ..PHOTONO PH0797/0003
> ..CREATOR Unknown
> ..COLLECTN Boerner Archive Collection
> ..RIGHTS Unknown
> ..ACCESS 1
> ..LOCATION Alice Springs, Northern Territory
> ..SUBJECTS children; horses; women</dcvalue>
> <dcvalue element="identifier" qualifier="other">PH0797/0003</dcvalue>
> <dcvalue element="identifier" qualifier="other">PH0797/0003</dcvalue>
> <dcvalue element="date" qualifier="created">20 November, 1906</dcvalue>
> <dcvalue element="date" qualifier="created">20 November, 1906</dcvalue>
> <dcvalue element="title" qualifier="none">On horseback</dcvalue>
> <dcvalue element="title" qualifier="none">On horseback</dcvalue>
> <dcvalue element="rights" qualifier="none">Unknown</dcvalue>
> <dcvalue element="rights" qualifier="none">Unknown</dcvalue>
> <dcvalue element="contributor" qualifier="none">Unknown</dcvalue>
> <dcvalue element="contributor" qualifier="none">Unknown</dcvalue>
> <dcvalue element="contributor" qualifier="other">Boerner Archive
> Collection</dcvalue>
> <dcvalue element="contributor" qualifier="other">Boerner Archive
> Collection</dcvalue>
> <dcvalue element="coverage" qualifier="spatial">Alice Springs,
> Northern Territory</dcvalue>
> <dcvalue element="coverage" qualifier="spatial">Alice Springs,
> Northern Territory</dcvalue>
> <dcvalue element="source">795-0003.JPG</dcvalue>
> </dublin_core>
>
>
> --
> --
> Stephen De Gabrielle
>


--
--
Stephen De Gabrielle