Skip to content
Snippets Groups Projects
Commit 201cb5e2 authored by Andreas Romeyke's avatar Andreas Romeyke
Browse files

- search metadata in bim-dictionary

- minor fix in option pronom_id
parent 27ab4f82
No related branches found
No related tags found
No related merge requests found
...@@ -141,11 +141,19 @@ sub line_result_mapper { ...@@ -141,11 +141,19 @@ sub line_result_mapper {
SLUBArchiv-sipVersion SLUBArchiv-sipVersion
Title Title
); );
foreach my $t (@tmd) { foreach my $t (@tmd) {
my $linekey = lc($t); $linekey=~s/-/_/g; my $linekey = lc($t); $linekey=~s/-/_/g;
my $optionkey = lc("with_".$t); $optionkey=~s/-/_/g; my $optionkey = lc("with_".$t); $optionkey=~s/-/_/g;
if (defined $opt->{$optionkey}) { if (exists $opt->{$optionkey}) {
$line{$linekey} = $partial_result->{_source}->{transferMetadata}->[0]->{ $t }; # FIXME: HashRef error in next line!
p($partial_result);
if (exists($partial_result->{_source}->{transferMetadata}->[0]->{'bim:bag-info_dict'}->{ "bim:$t" }) ) {
$line{$linekey} = $partial_result->{_source}->{transferMetadata}->[0]->{'bim:bag-info_dict'}->{ "bim:$t" };
} #else {
# say "$t -->";
#say np($partial_result);
#}
} }
} }
if (defined $opt->{with_creation_date}) { $line{creation_date} = $partial_result->{_source}->{created} }; if (defined $opt->{with_creation_date}) { $line{creation_date} = $partial_result->{_source}->{created} };
...@@ -230,7 +238,7 @@ sub execute { ...@@ -230,7 +238,7 @@ sub execute {
my $aips_query; my $aips_query;
my $aips_response; my $aips_response;
#p($opt); #p($opt);
if ($opt->{format} eq 'pronom_id') { if (exists $opt->{format} and $opt->{format} eq 'pronom_id') {
$aips_query = SLUB::LZA::TA::Archivematica::Elasticsearch::prepare_query($opt); $aips_query = SLUB::LZA::TA::Archivematica::Elasticsearch::prepare_query($opt);
# replace AIP query with all match # replace AIP query with all match
my @aips = find_aips_by_file_pronom_id(@_); my @aips = find_aips_by_file_pronom_id(@_);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment