line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Catmandu::Importer::WoSRelatedRecords; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
757
|
use Catmandu::Sane; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
16
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.0303'; |
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
287
|
use Moo; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
8
|
1
|
|
|
1
|
|
442
|
use Catmandu::Util qw(xml_escape); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
59
|
|
9
|
1
|
|
|
1
|
|
9
|
use namespace::clean; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
with 'Catmandu::WoS::SearchRecords'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
has uid => (is => 'ro', required => 1); |
14
|
|
|
|
|
|
|
has timespan_begin => (is => 'ro'); |
15
|
|
|
|
|
|
|
has timespan_end => (is => 'ro'); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub _search_content { |
18
|
0
|
|
|
0
|
|
|
my ($self, $start, $limit) = @_; |
19
|
|
|
|
|
|
|
|
20
|
0
|
|
|
|
|
|
my $uid = xml_escape($self->uid); |
21
|
|
|
|
|
|
|
|
22
|
0
|
|
|
|
|
|
my $timespan_xml = ''; |
23
|
0
|
0
|
0
|
|
|
|
if ($self->timespan_begin && $self->timespan_end) { |
24
|
0
|
|
|
|
|
|
my $tsb = $self->timespan_begin; |
25
|
0
|
|
|
|
|
|
my $tse = $self->timespan_end; |
26
|
0
|
|
|
|
|
|
$timespan_xml |
27
|
|
|
|
|
|
|
= "<timeSpan><begin>$tsb</begin><end>$tse</end></timeSpan>"; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
0
|
|
|
|
|
|
<<EOF; |
31
|
|
|
|
|
|
|
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" |
32
|
|
|
|
|
|
|
xmlns:woksearch="http://woksearch.v3.wokmws.thomsonreuters.com"> |
33
|
|
|
|
|
|
|
<soapenv:Header/> |
34
|
|
|
|
|
|
|
<soapenv:Body> |
35
|
|
|
|
|
|
|
<woksearch:relatedRecords> |
36
|
|
|
|
|
|
|
<databaseId>WOS</databaseId> |
37
|
|
|
|
|
|
|
<uid>$uid</uid> |
38
|
|
|
|
|
|
|
$timespan_xml |
39
|
|
|
|
|
|
|
<queryLanguage>en</queryLanguage> |
40
|
|
|
|
|
|
|
<retrieveParameters> |
41
|
|
|
|
|
|
|
<firstRecord>$start</firstRecord> |
42
|
|
|
|
|
|
|
<count>$limit</count> |
43
|
|
|
|
|
|
|
<option> |
44
|
|
|
|
|
|
|
<key>RecordIDs</key> |
45
|
|
|
|
|
|
|
<value>On</value> |
46
|
|
|
|
|
|
|
</option> |
47
|
|
|
|
|
|
|
<option> |
48
|
|
|
|
|
|
|
<key>targetNamespace</key> |
49
|
|
|
|
|
|
|
<value>http://scientific.thomsonreuters.com/schema/wok5.4/public/FullRecord</value> |
50
|
|
|
|
|
|
|
</option> |
51
|
|
|
|
|
|
|
</retrieveParameters> |
52
|
|
|
|
|
|
|
</woksearch:relatedRecords> |
53
|
|
|
|
|
|
|
</soapenv:Body> |
54
|
|
|
|
|
|
|
</soapenv:Envelope> |
55
|
|
|
|
|
|
|
EOF |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub _search_response_type { |
59
|
0
|
|
|
0
|
|
|
'relatedRecordsResponse'; |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
1; |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
__END__ |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=encoding utf-8 |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head1 NAME |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
Catmandu::Importer::WoSRelatedRecords - Import Web of Science related records for a given record |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=head1 SYNOPSIS |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
# On the command line |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
$ catmandu convert WoSRelatedRecords --username XXX --password XXX --uid 'WOS:000413520000001' to YAML |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
# In perl |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
use Catmandu::Importer::WoSRelatedRecords; |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
my $wos = Catmandu::Importer::WoSRelatedRecords->new(username => 'XXX', password => 'XXX', uid => 'WOS:000413520000001'); |
83
|
|
|
|
|
|
|
$wos->each(sub { |
84
|
|
|
|
|
|
|
my $record = shift; |
85
|
|
|
|
|
|
|
# ... |
86
|
|
|
|
|
|
|
}); |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head1 AUTHOR |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
Nicolas Steenlant E<lt>nicolas.steenlant@ugent.beE<gt> |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=head1 COPYRIGHT |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
Copyright 2017- Nicolas Steenlant |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=head1 LICENSE |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify |
99
|
|
|
|
|
|
|
it under the same terms as Perl itself. |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=head1 SEE ALSO |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=cut |