line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Catmandu::Fix::wd_simple; |
2
|
|
|
|
|
|
|
#ABSTRACT: Simplify Wikidata entity records |
3
|
|
|
|
|
|
|
our $VERSION = '0.06'; #VERSION |
4
|
1
|
|
|
1
|
|
1106
|
use Catmandu::Sane; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
6
|
|
5
|
1
|
|
|
1
|
|
192
|
use Moo; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
358
|
use Catmandu::Fix::wd_simple_strings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
19
|
|
8
|
1
|
|
|
1
|
|
4
|
use Catmandu::Fix::wd_simple_claims; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
19
|
|
9
|
1
|
|
|
1
|
|
6
|
use Catmandu::Fix::wd_language as => 'wd_language'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
11
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
has language => (is => 'ro', required => 0); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub fix { |
14
|
0
|
|
|
0
|
0
|
|
my ($self, $data) = @_; |
15
|
|
|
|
|
|
|
|
16
|
0
|
0
|
|
|
|
|
wd_language($data, $self->language) if $self->language; |
17
|
0
|
|
|
|
|
|
Catmandu::Fix::wd_simple_strings::fix($self,$data); |
18
|
0
|
|
|
|
|
|
Catmandu::Fix::wd_simple_claims::fix($self,$data); |
19
|
|
|
|
|
|
|
|
20
|
0
|
0
|
|
|
|
|
if (my $hash = $data->{sitelinks}) { |
21
|
0
|
|
|
|
|
|
foreach my $lang (keys %$hash) { |
22
|
0
|
|
|
|
|
|
delete $hash->{$lang}->{site}; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
0
|
|
|
|
|
|
$data; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
1; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
__END__ |