line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Shared::Fixture::Wikibase::Datatype::Sense::Wikidata::Dog; |
2
|
|
|
|
|
|
|
|
3
|
19
|
|
|
19
|
|
479775
|
use base qw(Wikibase::Datatype::Sense); |
|
19
|
|
|
|
|
69
|
|
|
19
|
|
|
|
|
7793
|
|
4
|
19
|
|
|
19
|
|
139
|
use strict; |
|
19
|
|
|
|
|
41
|
|
|
19
|
|
|
|
|
353
|
|
5
|
19
|
|
|
19
|
|
89
|
use warnings; |
|
19
|
|
|
|
|
46
|
|
|
19
|
|
|
|
|
455
|
|
6
|
|
|
|
|
|
|
|
7
|
19
|
|
|
19
|
|
9469
|
use Test::Shared::Fixture::Wikibase::Datatype::Statement::Wikidata::Image::Dog; |
|
19
|
|
|
|
|
66
|
|
|
19
|
|
|
|
|
718
|
|
8
|
19
|
|
|
19
|
|
8143
|
use Test::Shared::Fixture::Wikibase::Datatype::Statement::Wikidata::ItemForThisSense::Dog; |
|
19
|
|
|
|
|
66
|
|
|
19
|
|
|
|
|
609
|
|
9
|
19
|
|
|
19
|
|
1082
|
use Unicode::UTF8 qw(decode_utf8); |
|
19
|
|
|
|
|
1374
|
|
|
19
|
|
|
|
|
890
|
|
10
|
19
|
|
|
19
|
|
1084
|
use Wikibase::Datatype::Value::Monolingual; |
|
19
|
|
|
|
|
56
|
|
|
19
|
|
|
|
|
2442
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = 0.31; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub new { |
15
|
15
|
|
|
15
|
1
|
364
|
my $class = shift; |
16
|
|
|
|
|
|
|
|
17
|
15
|
|
|
|
|
108
|
my @params = ( |
18
|
|
|
|
|
|
|
'glosses' => [ |
19
|
|
|
|
|
|
|
Wikibase::Datatype::Value::Monolingual->new( |
20
|
|
|
|
|
|
|
'language' => 'en', |
21
|
|
|
|
|
|
|
'value' => 'domesticated mammal related to the wolf', |
22
|
|
|
|
|
|
|
), |
23
|
|
|
|
|
|
|
Wikibase::Datatype::Value::Monolingual->new( |
24
|
|
|
|
|
|
|
'language' => 'cs', |
25
|
|
|
|
|
|
|
'value' => decode_utf8('psovitá šelma chovaná jako domácí zvíře'), |
26
|
|
|
|
|
|
|
), |
27
|
|
|
|
|
|
|
], |
28
|
|
|
|
|
|
|
# https://www.wikidata.org/wiki/Lexeme:L469 |
29
|
|
|
|
|
|
|
'id' => 'L469-S1', |
30
|
|
|
|
|
|
|
'statements' => [ |
31
|
|
|
|
|
|
|
Test::Shared::Fixture::Wikibase::Datatype::Statement::Wikidata::Image::Dog->new, |
32
|
|
|
|
|
|
|
Test::Shared::Fixture::Wikibase::Datatype::Statement::Wikidata::ItemForThisSense::Dog->new, |
33
|
|
|
|
|
|
|
], |
34
|
|
|
|
|
|
|
); |
35
|
|
|
|
|
|
|
|
36
|
15
|
|
|
|
|
213
|
my $self = $class->SUPER::new(@params); |
37
|
|
|
|
|
|
|
|
38
|
15
|
|
|
|
|
649
|
return $self; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
__END__ |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=pod |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=encoding utf8 |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head1 NAME |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
Test::Shared::Fixture::Wikibase::Datatype::Sense::Wikidata::Dog - Test instance for Wikidata sense. |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 SYNOPSIS |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
use Test::Shared::Fixture::Wikibase::Datatype::Sense::Wikidata::Dog; |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
my $obj = Test::Shared::Fixture::Wikibase::Datatype::Sense::Wikidata::Dog->new; |
58
|
|
|
|
|
|
|
my $glosses_ar = $obj->glosses; |
59
|
|
|
|
|
|
|
my $id = $obj->id; |
60
|
|
|
|
|
|
|
my $statements_ar = $obj->statements; |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head1 DESCRIPTION |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
This datatype is snak class for representing relation between property and value. |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head1 METHODS |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head2 C<new> |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
my $obj = Test::Shared::Fixture::Wikibase::Datatype::Sense::Wikidata::Dog->new; |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
Constructor. |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
Returns instance of object. |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=head2 C<glosses> |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
my $glosses_ar = $obj->glosses; |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
Get glosses. |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
Returns reference to array with Wikibase::Datatype::Value::Monolingual instances. |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=head2 C<id> |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
my $id = $obj->id; |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
Get id. |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
Returns string. |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=head2 C<statements> |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
my $statements_ar = $obj->statements; |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
Get statements. |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
Returns reference to array with Wikibase::Datatype::Statement instances. |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=head1 EXAMPLE |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=for comment filename=fixture_create_and_print_sense_wd_dog.pl |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
use strict; |
105
|
|
|
|
|
|
|
use warnings; |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
use Test::Shared::Fixture::Wikibase::Datatype::Sense::Wikidata::Dog; |
108
|
|
|
|
|
|
|
use Unicode::UTF8 qw(encode_utf8); |
109
|
|
|
|
|
|
|
use Wikibase::Datatype::Print::Sense; |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
# Object. |
112
|
|
|
|
|
|
|
my $obj = Test::Shared::Fixture::Wikibase::Datatype::Sense::Wikidata::Dog->new; |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
# Print out. |
115
|
|
|
|
|
|
|
print encode_utf8(scalar Wikibase::Datatype::Print::Sense::print($obj)); |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
# Output: |
118
|
|
|
|
|
|
|
# Id: L469-S1 |
119
|
|
|
|
|
|
|
# Glosses: |
120
|
|
|
|
|
|
|
# domesticated mammal related to the wolf (en) |
121
|
|
|
|
|
|
|
# psovitá šelma chovaná jako domácí zvíře (cs) |
122
|
|
|
|
|
|
|
# Statements: |
123
|
|
|
|
|
|
|
# P18: Canadian Inuit Dog.jpg (normal) |
124
|
|
|
|
|
|
|
# P5137: Q144 (normal) |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
=head1 DEPENDENCIES |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
L<Test::Shared::Fixture::Wikibase::Datatype::Statement::Wikidata::Image::Dog>, |
129
|
|
|
|
|
|
|
L<Test::Shared::Fixture::Wikibase::Datatype::Statement::Wikidata::ItemForThisSense::Dog>, |
130
|
|
|
|
|
|
|
L<Unicode::UTF8>, |
131
|
|
|
|
|
|
|
L<Wikibase::Datatype::Sense>, |
132
|
|
|
|
|
|
|
L<Wikibase::Datatype::Value::Monolingual>. |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
=head1 SEE ALSO |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
=over |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
=item L<Wikibase::Datatype> |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
Wikibase datatypes. |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
=item L<Wikibase::Datatype::Sense> |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
Wikibase sense datatype. |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
=back |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
=head1 REPOSITORY |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
L<https://github.com/michal-josef-spacek/Wikibase-Datatype> |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
=head1 AUTHOR |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
Michal Josef Špaček L<mailto:skim@cpan.org> |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
L<http://skim.cz> |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
© 2020-2023 Michal Josef Špaček |
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
BSD 2-Clause License |
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
=head1 VERSION |
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
0.31 |
167
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
=cut |