Add more Gingko meta data fields
Change-Id: I3f3f7c53ae46aec52547982dad4c35acda89961d
diff --git a/lib/KorAP/XML/Krill.pm b/lib/KorAP/XML/Krill.pm
index 66f481d..cd53751 100644
--- a/lib/KorAP/XML/Krill.pm
+++ b/lib/KorAP/XML/Krill.pm
@@ -16,7 +16,7 @@
our @EXPORT_OK = qw(get_file_name get_file_name_from_glob);
-our $VERSION = '0.43';
+our $VERSION = '0.44';
has 'path';
has [qw/text_sigle doc_sigle corpus_sigle/];
diff --git a/lib/KorAP/XML/Meta/Base.pm b/lib/KorAP/XML/Meta/Base.pm
index 21e4297..b00d894 100644
--- a/lib/KorAP/XML/Meta/Base.pm
+++ b/lib/KorAP/XML/Meta/Base.pm
@@ -160,9 +160,9 @@
elsif (index($_, 'T_') == 0) {
push @fields, _text_field(_k($_), $self->{$_});
}
- # elsif (index($_, 'I_') == 0) {
- # _int_field(_k($_), $self->{$_});
- # }
+ elsif (index($_, 'I_') == 0) {
+ push @fields, _int_field(_k($_), $self->{$_});
+ }
elsif (index($_, 'A_') == 0) {
push @fields, _attachement_field(_k($_), $self->{$_});
}
@@ -260,4 +260,14 @@
};
};
+sub _int_field {
+ return {
+ '@type' => 'koral:field',
+ type => 'type:integer',
+ key => $_[0],
+ value => $_[1]
+ };
+};
+
+
1;
diff --git a/lib/KorAP/XML/Meta/Gingko.pm b/lib/KorAP/XML/Meta/Gingko.pm
index 821b0d3..83ac9ac 100644
--- a/lib/KorAP/XML/Meta/Gingko.pm
+++ b/lib/KorAP/XML/Meta/Gingko.pm
@@ -36,10 +36,25 @@
};
};
+ if (my $analytic = $dom->at('sourceDesc > biblStruct > analytic')) {
+ if ($temp = $analytic->at('biblNote[n=DOI]')) {
+ $temp = $squish->($temp->all_text);
+ if ($temp) {
+ $self->{A_gingko_article_DOI} = $self->korap_data_uri('https://doi.org/' . $temp, title => 'doi:' . $temp);
+ };
+ };
+ };
+
if ($temp = $dom->at('correction')) {
$temp = $squish->($temp->all_text);
$self->{S_gingko_lemma_corr} = $temp if $temp;
};
+
+ if ($temp = $dom->at('encodingDesc > tagsDecl > tagUsage[gi=w]')) {
+ if ($temp->attr('occurs')) {
+ $self->{I_gingko_text_tokens} = $temp->attr('occurs');
+ };
+ };
}
elsif ($type eq 'corpus') {
@@ -53,6 +68,17 @@
$temp = $squish->($temp->all_text);
$self->{S_gingko_collection_short} = $temp if $temp;
};
+
+ if ($temp = $mono->at('biblNote[n="url"]')) {
+ $temp = $squish->($temp->all_text);
+ $self->{A_external_link} = $self->korap_data_uri($temp, title => 'Gingko-Webseite an der Universität Leipzig');
+ };
+
+ if ($temp = $mono->at('biblNote[n="url.ids"]')) {
+ $temp = $squish->($temp->all_text);
+ $self->{A_internal_link} = $self->korap_data_uri($temp, title => 'IDS webpage on Gingko in the DeReKo archive');
+ };
+
};
};
};