File Coverage

blib/lib/Test/Shared/Fixture/Wikibase/Datatype/Property/Wikidata/InstanceOf.pm
Criterion Covered Total %
statement 19 19 100.0
branch n/a
condition n/a
subroutine 6 6 100.0
pod 1 1 100.0
total 26 26 100.0


line stmt bran cond sub pod time code
1             package Test::Shared::Fixture::Wikibase::Datatype::Property::Wikidata::InstanceOf;
2              
3 3     3   360925 use base qw(Wikibase::Datatype::Property);
  3         39  
  3         1490  
4 3     3   21 use strict;
  3         6  
  3         82  
5 3     3   14 use warnings;
  3         8  
  3         125  
6              
7 3     3   1491 use Test::Shared::Fixture::Wikibase::Datatype::Statement::Wikidata::InstanceOf::WikidataProperty;
  3         10  
  3         104  
8 3     3   992 use Wikibase::Datatype::Value::Monolingual;
  3         7  
  3         460  
9              
10             our $VERSION = 0.31;
11              
12             sub new {
13 1     1 1 116 my $class = shift;
14              
15 1         17 my @params = (
16             'aliases' => [
17             Wikibase::Datatype::Value::Monolingual->new(
18             'language' => 'en',
19             'value' => 'is a',
20             ),
21             Wikibase::Datatype::Value::Monolingual->new(
22             'language' => 'en',
23             'value' => 'is an',
24             ),
25             ],
26             'datatype' => 'wikibase-item',
27             'descriptions' => [
28             Wikibase::Datatype::Value::Monolingual->new(
29             'language' => 'en',
30             'value' => 'that class of which this subject is a particular example and member',
31             ),
32             ],
33             'id' => 'P31',
34             'labels' => [
35             Wikibase::Datatype::Value::Monolingual->new(
36             'language' => 'en',
37             'value' => 'instance of',
38             ),
39             ],
40             'lastrevid' => 1645333097,
41             'modified' => '2022-06-24T13:05:10Z',
42             'page_id' => 3918489,
43             'statements' => [
44             Test::Shared::Fixture::Wikibase::Datatype::Statement::Wikidata::InstanceOf::WikidataProperty->new,
45             ],
46             'title' => 'Property:P31',
47             );
48              
49 1         10 my $self = $class->SUPER::new(@params);
50              
51 1         10 return $self;
52             }
53              
54             1;
55              
56             __END__
57              
58             =pod
59              
60             =encoding utf8
61              
62             =head1 NAME
63              
64             Test::Shared::Fixture::Wikibase::Datatype::Property::Wikidata::InstanceOf - Test instance for Wikidata property.
65              
66             =head1 SYNOPSIS
67              
68             use Test::Shared::Fixture::Wikibase::Datatype::Property::Wikidata::InstanceOf;
69              
70             my $obj = Test::Shared::Fixture::Wikibase::Datatype::Property::Wikidata::InstanceOf->new;
71             my $aliases_ar = $obj->aliases;
72             my $datatype = $obj->datatype;
73             my $descriptions_ar = $obj->descriptions;
74             my $id = $obj->id;
75             my $labels_ar = $obj->labels;
76             my $lastrevid = $obj->lastrevid;
77             my $modified = $obj->modified;
78             my $ns = $obj->ns;
79             my $page_id = $obj->page_id;
80             my $statements_ar = $obj->statements;
81             my $title = $obj->title;
82              
83             =head1 METHODS
84              
85             =head2 C<new>
86              
87             my $obj = Test::Shared::Fixture::Wikibase::Datatype::Property::Wikidata::InstanceOf->new;
88              
89             Constructor.
90              
91             Returns instance of object.
92              
93             =head2 C<aliases>
94              
95             my $aliases_ar = $obj->aliases;
96              
97             Get aliases.
98              
99             Returns reference to array with Wikibase::Datatype::Value::Monolingual instances.
100              
101             =head2 C<datatype>
102              
103             my $datatype = $obj->datatype;
104              
105             Get data type.
106              
107             Returns string.
108              
109             =head2 C<descriptions>
110              
111             my $descriptions_ar = $obj->descriptions;
112              
113             Get descriptions.
114              
115             Returns reference to array with Wikibase::Datatype::Value::Monolingual instances.
116              
117             =head2 C<id>
118              
119             my $id = $obj->id;
120              
121             Get id.
122              
123             Returns string.
124              
125             =head2 C<labels>
126              
127             my $labels_ar = $obj->labels;
128              
129             Get labels.
130              
131             Returns reference to array with Wikibase::Datatype::Value::Monolingual instances.
132              
133             =head2 C<lastrevid>
134              
135             my $lastrevid = $obj->lastrevid;
136              
137             Get last revision ID.
138              
139             Returns string.
140              
141             =head2 C<modified>
142              
143             my $modified = $obj->modified;
144              
145             Get date of modification.
146              
147             Returns string.
148              
149             =head2 C<ns>
150              
151             my $ns = $obj->ns;
152              
153             Get namespace.
154              
155             Returns number.
156              
157             =head2 C<page_id>
158              
159             my $page_id = $obj->page_id;
160              
161             Get page id.
162              
163             Returns number.
164              
165             =head2 C<statements>
166              
167             my $statements_ar = $obj->statements;
168              
169             Get statements.
170              
171             Returns reference to array with Wikibase::Datatype::Statement instances.
172              
173             =head2 C<title>
174              
175             my $title = $obj->title;
176              
177             Get title.
178              
179             Returns string.
180              
181             =head1 EXAMPLE
182              
183             =for comment filename=fixture_create_and_print_property_wd_instance_of.pl
184              
185             use strict;
186             use warnings;
187              
188             use Test::Shared::Fixture::Wikibase::Datatype::Property::Wikidata::InstanceOf;
189             use Wikibase::Datatype::Print::Property;
190              
191             # Object.
192             my $obj = Test::Shared::Fixture::Wikibase::Datatype::Property::Wikidata::InstanceOf->new;
193              
194             # Print out.
195             print scalar Wikibase::Datatype::Print::Property::print($obj);
196              
197             # Output:
198             # Data type: wikibase-item
199             # Label: instance of (en)
200             # Description: that class of which this subject is a particular example and member (en)
201             # Aliases:
202             # is a (en)
203             # is an (en)
204             # Statements:
205             # P31: Q32753077 (normal)
206              
207             =head1 DEPENDENCIES
208              
209             L<Test::Shared::Fixture::Wikibase::Datatype::Statement::Wikidata::InstanceOf::WikidataProperty>,
210             L<Wikibase::Datatype::Property>,
211             L<Wikibase::Datatype::Value::Monolingual>.
212              
213             =head1 SEE ALSO
214              
215             =over
216              
217             =item L<Wikibase::Datatype>
218              
219             Wikibase datatypes.
220              
221             =item L<Wikibase::Datatype::Property>
222              
223             Wikibase property datatype.
224              
225             =back
226              
227             =head1 REPOSITORY
228              
229             L<https://github.com/michal-josef-spacek/Wikibase-Datatype>
230              
231             =head1 AUTHOR
232              
233             Michal Josef Špaček L<mailto:skim@cpan.org>
234              
235             L<http://skim.cz>
236              
237             =head1 LICENSE AND COPYRIGHT
238              
239             © 2020-2023 Michal Josef Špaček
240              
241             BSD 2-Clause License
242              
243             =head1 VERSION
244              
245             0.31
246              
247             =cut