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