File Coverage

blib/lib/Wikibase/Datatype/Struct/Item.pm
Criterion Covered Total %
statement 105 105 100.0
branch 34 34 100.0
condition 5 5 100.0
subroutine 12 12 100.0
pod 2 2 100.0
total 158 158 100.0


line stmt bran cond sub pod time code
1              
2             use base qw(Exporter);
3 4     4   438744 use strict;
  4         36  
  4         448  
4 4     4   22 use warnings;
  4         7  
  4         60  
5 4     4   17  
  4         5  
  4         99  
6             use Error::Pure qw(err);
7 4     4   1010 use Readonly;
  4         18260  
  4         73  
8 4     4   132 use Wikibase::Datatype::Item;
  4         6  
  4         103  
9 4     4   1257 use Wikibase::Datatype::Struct::Language;
  4         12724  
  4         104  
10 4     4   1293 use Wikibase::Datatype::Struct::Sitelink;
  4         10  
  4         155  
11 4     4   1415 use Wikibase::Datatype::Struct::Statement;
  4         9  
  4         143  
12 4     4   1383 use Wikibase::Datatype::Struct::Value::Monolingual;
  4         12  
  4         139  
13 4     4   22  
  4         16  
  4         2618  
14             Readonly::Array our @EXPORT_OK => qw(obj2struct struct2obj);
15              
16             our $VERSION = 0.09;
17              
18             my ($obj, $base_uri) = @_;
19              
20 7     7 1 21899 if (! defined $obj) {
21             err "Object doesn't exist.";
22 7 100       20 }
23 1         5 if (! $obj->isa('Wikibase::Datatype::Item')) {
24             err "Object isn't 'Wikibase::Datatype::Item'.";
25 6 100       26 }
26 1         6 if (! defined $base_uri) {
27             err 'Base URI is required.';
28 5 100       12 }
29 1         3  
30             my $struct_hr = {
31             'type' => 'item',
32 4         8 };
33              
34             # Aliases.
35             foreach my $alias (@{$obj->aliases}) {
36             if (! exists $struct_hr->{'aliases'}->{$alias->language}) {
37 4         7 $struct_hr->{'aliases'}->{$alias->language} = [];
  4         11  
38 4 100       26 }
39 2         17 push @{$struct_hr->{'aliases'}->{$alias->language}},
40             Wikibase::Datatype::Struct::Language::obj2struct($alias);
41 4         22 }
  4         9  
42              
43             # Claims.
44             foreach my $statement (@{$obj->statements}) {
45             $struct_hr->{'claims'}->{$statement->snak->property} //= [];
46 4         24 push @{$struct_hr->{'claims'}->{$statement->snak->property}},
  4         9  
47 4   100     23 Wikibase::Datatype::Struct::Statement::obj2struct($statement, $base_uri);
48 4         60 }
  4         10  
49              
50             # Descriptions.
51             foreach my $desc (@{$obj->descriptions}) {
52             $struct_hr->{'descriptions'}->{$desc->language}
53 4         19 = Wikibase::Datatype::Struct::Language::obj2struct($desc);
  4         8  
54 2         26 }
55              
56             # Id.
57             if (defined $obj->id) {
58             $struct_hr->{'id'} = $obj->id;
59 4 100       27 }
60 1         7  
61             # Labels.
62             foreach my $label (@{$obj->labels}) {
63             $struct_hr->{'labels'}->{$label->language}
64 4         29 = Wikibase::Datatype::Struct::Language::obj2struct($label);
  4         7  
65 2         14 }
66            
67             # Last revision id.
68             if (defined $obj->lastrevid) {
69             $struct_hr->{'lastrevid'} = $obj->lastrevid;
70 4 100       29 }
71 1         7  
72             # Modified date.
73             if (defined $obj->modified) {
74             $struct_hr->{'modified'} = $obj->modified;
75 4 100       30 }
76 1         8  
77             # Namespace.
78             if (defined $obj->ns) {
79             $struct_hr->{'ns'} = $obj->ns;
80 4 100       23 }
81 3         27  
82             # Page ID.
83             if (defined $obj->page_id) {
84             $struct_hr->{'pageid'} = $obj->page_id;
85 4 100       30 }
86 1         8  
87             # Sitelinks.
88             foreach my $sitelink (@{$obj->sitelinks}) {
89             $struct_hr->{'sitelinks'}->{$sitelink->site}
90 4         21 = Wikibase::Datatype::Struct::Sitelink::obj2struct($sitelink);
  4         8  
91 2         16 }
92              
93             # Title.
94             if (defined $obj->title) {
95             $struct_hr->{'title'} = $obj->title;
96 4 100       27 }
97 1         16  
98             return $struct_hr;
99             }
100 4         52  
101             my $struct_hr = shift;
102              
103             if (! exists $struct_hr->{'type'} || $struct_hr->{'type'} ne 'item') {
104 5     5 1 10075 err "Structure isn't for 'item' type.";
105             }
106 5 100 100     32  
107 2         8 # Aliases.
108             my $aliases_ar = [];
109             foreach my $lang (keys %{$struct_hr->{'aliases'}}) {
110             foreach my $alias_hr (@{$struct_hr->{'aliases'}->{$lang}}) {
111 3         8 push @{$aliases_ar}, Wikibase::Datatype::Struct::Language::struct2obj(
112 3         6 $alias_hr,
  3         13  
113 2         3 );
  2         6  
114 4         6 }
  4         11  
115             }
116              
117             # Descriptions.
118             my $descriptions_ar = [];
119             foreach my $lang (keys %{$struct_hr->{'descriptions'}}) {
120             push @{$descriptions_ar}, Wikibase::Datatype::Struct::Language::struct2obj(
121 3         8 $struct_hr->{'descriptions'}->{$lang},
122 3         6 );
  3         9  
123 2         6 }
124 2         3  
125             # Labels.
126             my $labels_ar = [];
127             foreach my $lang (keys %{$struct_hr->{'labels'}}) {
128             push @{$labels_ar}, Wikibase::Datatype::Struct::Language::struct2obj(
129 3         7 $struct_hr->{'labels'}->{$lang},
130 3         5 );
  3         10  
131 2         7 }
132 2         3  
133             # Sitelinks.
134             my $sitelinks_ar = [];
135             foreach my $site (keys %{$struct_hr->{'sitelinks'}}) {
136             push @{$sitelinks_ar}, Wikibase::Datatype::Struct::Sitelink::struct2obj(
137 3         6 $struct_hr->{'sitelinks'}->{$site},
138 3         5 );
  3         11  
139 2         8 }
140 2         3  
141             # Statements.
142             my $statements_ar = [];
143             foreach my $property (keys %{$struct_hr->{'claims'}}) {
144             foreach my $claim_hr (@{$struct_hr->{'claims'}->{$property}}) {
145 3         6 push @{$statements_ar}, Wikibase::Datatype::Struct::Statement::struct2obj(
146 3         7 $claim_hr,
  3         9  
147 2         4 );
  2         6  
148 2         3 }
  2         8  
149             }
150              
151             my $obj = Wikibase::Datatype::Item->new(
152             'aliases' => $aliases_ar,
153             'descriptions' => $descriptions_ar,
154             defined $struct_hr->{'id'} ? ('id' => $struct_hr->{'id'}) : (),
155             'labels' => $labels_ar,
156             defined $struct_hr->{'lastrevid'} ? ('lastrevid' => $struct_hr->{'lastrevid'}) : (),
157             defined $struct_hr->{'modified'} ? ('modified' => $struct_hr->{'modified'}) : (),
158             defined $struct_hr->{'ns'} ? ('ns' => $struct_hr->{'ns'}) : (),
159             defined $struct_hr->{'pageid'} ? ('page_id' => $struct_hr->{'pageid'}) : (),
160             'sitelinks' => $sitelinks_ar,
161             'statements' => $statements_ar,
162             defined $struct_hr->{'title'} ? ('title' => $struct_hr->{'title'}) : (),
163             );
164              
165 3 100       50 return $obj;
    100          
    100          
    100          
    100          
    100          
166             }
167              
168 3         591 1;
169              
170              
171             =pod
172              
173             =encoding utf8
174              
175             =head1 NAME
176              
177             Wikibase::Datatype::Struct::Item - Wikibase item structure serialization.
178              
179             =head1 SYNOPSIS
180              
181             use Wikibase::Datatype::Struct::Item qw(obj2struct struct2obj);
182              
183             my $struct_hr = obj2struct($obj, $base_uri);
184             my $obj = struct2obj($struct_hr);
185              
186             =head1 DESCRIPTION
187              
188             This conversion is between objects defined in Wikibase::Datatype and structures
189             serialized via JSON to MediaWiki.
190              
191             =head1 SUBROUTINES
192              
193             =head2 C<obj2struct>
194              
195             my $struct_hr = obj2struct($obj, $base_uri);
196              
197             Convert Wikibase::Datatype::Item instance to structure.
198             C<$base_uri> is base URI of Wikibase system (e.g. http://test.wikidata.org/entity/).
199              
200             Returns reference to hash with structure.
201              
202             =head2 C<struct2obj>
203              
204             my $obj = struct2obj($struct_hr);
205              
206             Convert structure of item to object.
207              
208             Returns Wikibase::Datatype::Item instance.
209              
210             =head1 ERRORS
211              
212             obj2struct():
213             Base URI is required.
214             Object doesn't exist.
215             Object isn't 'Wikibase::Datatype::Item'.
216              
217             struct2obj():
218             Structure isn't for 'item' type.
219              
220             =head1 EXAMPLE1
221              
222             use strict;
223             use warnings;
224              
225             use Data::Printer;
226             use Wikibase::Datatype::Item;
227             use Wikibase::Datatype::Reference;
228             use Wikibase::Datatype::Sitelink;
229             use Wikibase::Datatype::Snak;
230             use Wikibase::Datatype::Statement;
231             use Wikibase::Datatype::Struct::Item qw(obj2struct);
232             use Wikibase::Datatype::Value::Item;
233             use Wikibase::Datatype::Value::Monolingual;
234             use Wikibase::Datatype::Value::String;
235             use Wikibase::Datatype::Value::Time;
236              
237             # Object.
238             my $statement1 = Wikibase::Datatype::Statement->new(
239             # instance of (P31) human (Q5)
240             'snak' => Wikibase::Datatype::Snak->new(
241             'datatype' => 'wikibase-item',
242             'datavalue' => Wikibase::Datatype::Value::Item->new(
243             'value' => 'Q5',
244             ),
245             'property' => 'P31',
246             ),
247             'property_snaks' => [
248             # of (P642) alien (Q474741)
249             Wikibase::Datatype::Snak->new(
250             'datatype' => 'wikibase-item',
251             'datavalue' => Wikibase::Datatype::Value::Item->new(
252             'value' => 'Q474741',
253             ),
254             'property' => 'P642',
255             ),
256             ],
257             'references' => [
258             Wikibase::Datatype::Reference->new(
259             'snaks' => [
260             # stated in (P248) Virtual International Authority File (Q53919)
261             Wikibase::Datatype::Snak->new(
262             'datatype' => 'wikibase-item',
263             'datavalue' => Wikibase::Datatype::Value::Item->new(
264             'value' => 'Q53919',
265             ),
266             'property' => 'P248',
267             ),
268              
269             # VIAF ID (P214) 113230702
270             Wikibase::Datatype::Snak->new(
271             'datatype' => 'external-id',
272             'datavalue' => Wikibase::Datatype::Value::String->new(
273             'value' => '113230702',
274             ),
275             'property' => 'P214',
276             ),
277              
278             # retrieved (P813) 7 December 2013
279             Wikibase::Datatype::Snak->new(
280             'datatype' => 'time',
281             'datavalue' => Wikibase::Datatype::Value::Time->new(
282             'value' => '+2013-12-07T00:00:00Z',
283             ),
284             'property' => 'P813',
285             ),
286             ],
287             ),
288             ],
289             );
290             my $statement2 = Wikibase::Datatype::Statement->new(
291             # sex or gender (P21) male (Q6581097)
292             'snak' => Wikibase::Datatype::Snak->new(
293             'datatype' => 'wikibase-item',
294             'datavalue' => Wikibase::Datatype::Value::Item->new(
295             'value' => 'Q6581097',
296             ),
297             'property' => 'P21',
298             ),
299             'references' => [
300             Wikibase::Datatype::Reference->new(
301             'snaks' => [
302             # stated in (P248) Virtual International Authority File (Q53919)
303             Wikibase::Datatype::Snak->new(
304             'datatype' => 'wikibase-item',
305             'datavalue' => Wikibase::Datatype::Value::Item->new(
306             'value' => 'Q53919',
307             ),
308             'property' => 'P248',
309             ),
310              
311             # VIAF ID (P214) 113230702
312             Wikibase::Datatype::Snak->new(
313             'datatype' => 'external-id',
314             'datavalue' => Wikibase::Datatype::Value::String->new(
315             'value' => '113230702',
316             ),
317             'property' => 'P214',
318             ),
319              
320             # retrieved (P813) 7 December 2013
321             Wikibase::Datatype::Snak->new(
322             'datatype' => 'time',
323             'datavalue' => Wikibase::Datatype::Value::Time->new(
324             'value' => '+2013-12-07T00:00:00Z',
325             ),
326             'property' => 'P813',
327             ),
328             ],
329             ),
330             ],
331             );
332              
333             # Main item.
334             my $obj = Wikibase::Datatype::Item->new(
335             'aliases' => [
336             Wikibase::Datatype::Value::Monolingual->new(
337             'language' => 'cs',
338             'value' => 'Douglas Noël Adams',
339             ),
340             Wikibase::Datatype::Value::Monolingual->new(
341             'language' => 'cs',
342             'value' => 'Douglas Noel Adams',
343             ),
344             Wikibase::Datatype::Value::Monolingual->new(
345             'language' => 'cs',
346             'value' => 'Douglas N. Adams',
347             ),
348             Wikibase::Datatype::Value::Monolingual->new(
349             'language' => 'en',
350             'value' => 'Douglas Noel Adams',
351             ),
352             Wikibase::Datatype::Value::Monolingual->new(
353             'language' => 'en',
354             'value' => 'Douglas Noël Adams',
355             ),
356             Wikibase::Datatype::Value::Monolingual->new(
357             'language' => 'en',
358             'value' => 'Douglas N. Adams',
359             ),
360             ],
361             'descriptions' => [
362             Wikibase::Datatype::Value::Monolingual->new(
363             'language' => 'cs',
364             'value' => 'anglický spisovatel, humorista a dramatik',
365             ),
366             Wikibase::Datatype::Value::Monolingual->new(
367             'language' => 'en',
368             'value' => 'English writer and humorist',
369             ),
370             ],
371             'id' => 'Q42',
372             'labels' => [
373             Wikibase::Datatype::Value::Monolingual->new(
374             'language' => 'cs',
375             'value' => 'Douglas Adams',
376             ),
377             Wikibase::Datatype::Value::Monolingual->new(
378             'language' => 'en',
379             'value' => 'Douglas Adams',
380             ),
381             ],
382             'page_id' => 123,
383             'sitelinks' => [
384             Wikibase::Datatype::Sitelink->new(
385             'site' => 'cswiki',
386             'title' => 'Douglas Adams',
387             ),
388             Wikibase::Datatype::Sitelink->new(
389             'site' => 'enwiki',
390             'title' => 'Douglas Adams',
391             ),
392             ],
393             'statements' => [
394             $statement1,
395             $statement2,
396             ],
397             'title' => 'Q42',
398             );
399              
400             # Get structure.
401             my $struct_hr = obj2struct($obj, 'http://test.wikidata.org/entity/');
402              
403             # Dump to output.
404             p $struct_hr;
405              
406             # Output:
407             # \ {
408             # aliases {
409             # cs [
410             # [0] {
411             # language "cs",
412             # value "Douglas Noël Adams"
413             # },
414             # [1] {
415             # language "cs",
416             # value "Douglas Noel Adams"
417             # },
418             # [2] {
419             # language "cs",
420             # value "Douglas N. Adams"
421             # }
422             # ],
423             # en [
424             # [0] {
425             # language "en",
426             # value "Douglas Noel Adams"
427             # },
428             # [1] {
429             # language "en",
430             # value "Douglas Noël Adams"
431             # },
432             # [2] {
433             # language "en",
434             # value "Douglas N. Adams"
435             # }
436             # ]
437             # },
438             # descriptions {
439             # cs {
440             # language "cs",
441             # value "anglický spisovatel, humorista a dramatik"
442             # },
443             # en {
444             # language "en",
445             # value "English writer and humorist"
446             # }
447             # },
448             # id "Q42",
449             # labels {
450             # cs {
451             # language "cs",
452             # value "Douglas Adams"
453             # },
454             # en {
455             # language "en",
456             # value "Douglas Adams"
457             # }
458             # },
459             # ns 0,
460             # pageid 123,
461             # sitelinks {
462             # cswiki {
463             # badges [],
464             # site "cswiki",
465             # title "Douglas Adams"
466             # },
467             # enwiki {
468             # badges [],
469             # site "enwiki",
470             # title "Douglas Adams"
471             # }
472             # },
473             # claims {
474             # P21 [
475             # [0] {
476             # mainsnak {
477             # datatype "wikibase-item",
478             # datavalue {
479             # type "wikibase-entityid",
480             # value {
481             # entity-type "item",
482             # id "Q6581097",
483             # numeric-id 6581097
484             # }
485             # },
486             # property "P21",
487             # snaktype "value"
488             # },
489             # rank "normal",
490             # references [
491             # [0] {
492             # snaks {
493             # P214 [
494             # [0] {
495             # datatype "external-id",
496             # datavalue {
497             # type "string",
498             # value 113230702
499             # },
500             # property "P214",
501             # snaktype "value"
502             # }
503             # ],
504             # P248 [
505             # [0] {
506             # datatype "wikibase-item",
507             # datavalue {
508             # type "wikibase-entityid",
509             # value {
510             # entity-type "item",
511             # id "Q53919",
512             # numeric-id 53919
513             # }
514             # },
515             # property "P248",
516             # snaktype "value"
517             # }
518             # ],
519             # P813 [
520             # [0] {
521             # datatype "time",
522             # datavalue {
523             # type "time",
524             # value {
525             # after 0,
526             # before 0,
527             # calendarmodel "http://test.wikidata.org/entity/Q1985727",
528             # precision 11,
529             # time "+2013-12-07T00:00:00Z",
530             # timezone 0
531             # }
532             # },
533             # property "P813",
534             # snaktype "value"
535             # }
536             # ]
537             # },
538             # snaks-order [
539             # [0] "P248",
540             # [1] "P214",
541             # [2] "P813"
542             # ]
543             # }
544             # ],
545             # type "statement"
546             # }
547             # ],
548             # P31 [
549             # [0] {
550             # mainsnak {
551             # datatype "wikibase-item",
552             # datavalue {
553             # type "wikibase-entityid",
554             # value {
555             # entity-type "item",
556             # id "Q5",
557             # numeric-id 5
558             # }
559             # },
560             # property "P31",
561             # snaktype "value"
562             # },
563             # qualifiers {
564             # P642 [
565             # [0] {
566             # datatype "wikibase-item",
567             # datavalue {
568             # type "wikibase-entityid",
569             # value {
570             # entity-type "item",
571             # id "Q474741",
572             # numeric-id 474741
573             # }
574             # },
575             # property "P642",
576             # snaktype "value"
577             # }
578             # ]
579             # },
580             # qualifiers-order [
581             # [0] "P642"
582             # ],
583             # rank "normal",
584             # references [
585             # [0] {
586             # snaks {
587             # P214 [
588             # [0] {
589             # datatype "external-id",
590             # datavalue {
591             # type "string",
592             # value 113230702
593             # },
594             # property "P214",
595             # snaktype "value"
596             # }
597             # ],
598             # P248 [
599             # [0] {
600             # datatype "wikibase-item",
601             # datavalue {
602             # type "wikibase-entityid",
603             # value {
604             # entity-type "item",
605             # id "Q53919",
606             # numeric-id 53919
607             # }
608             # },
609             # property "P248",
610             # snaktype "value"
611             # }
612             # ],
613             # P813 [
614             # [0] {
615             # datatype "time",
616             # datavalue {
617             # type "time",
618             # value {
619             # after 0,
620             # before 0,
621             # calendarmodel "http://test.wikidata.org/entity/Q1985727",
622             # precision 11,
623             # time "+2013-12-07T00:00:00Z",
624             # timezone 0
625             # }
626             # },
627             # property "P813",
628             # snaktype "value"
629             # }
630             # ]
631             # },
632             # snaks-order [
633             # [0] "P248",
634             # [1] "P214",
635             # [2] "P813"
636             # ]
637             # }
638             # ],
639             # type "statement"
640             # }
641             # ]
642             # },
643             # title "Q42",
644             # type "item"
645             # }
646              
647             =head1 EXAMPLE2
648              
649             use strict;
650             use warnings;
651              
652             use Data::Printer;
653             use Wikibase::Datatype::Struct::Item qw(struct2obj);
654              
655             # Item structure.
656             my $struct_hr = {
657             'aliases' => {
658             'en' => [{
659             'language' => 'en',
660             'value' => 'Douglas Noel Adams',
661             }, {
662             'language' => 'en',
663             'value' => 'Douglas Noël Adams',
664             }],
665             'cs' => [{
666             'language' => 'cs',
667             'value' => 'Douglas Noel Adams',
668             }, {
669             'language' => 'cs',
670             'value' => 'Douglas Noël Adams',
671             }],
672             },
673             'claims' => {
674             'P394' => [{
675             'rank' => 'normal',
676             'id' => 'Q42$c763016e-49e0-89b9-f717-2b18af5148f9',
677             'references' => [{
678             'hash' => 'ed9d0472fca124cea519c0a37eba5f33f10baa22',
679             'snaks' => {
680             'P1943' => [{
681             'datavalue' => {
682             'type' => 'string',
683             'value' => 'http://wikipedia.org/',
684             },
685             'datatype' => 'url',
686             'snaktype' => 'value',
687             'hash' => 'b808d4d54bed4daf07d9ac73353c0d1173cfa3c0',
688             'property' => 'P1943',
689             }],
690             },
691             'snaks-order' => [
692             'P1943',
693             ],
694             }],
695             'type' => 'statement',
696             'mainsnak' => {
697             'datatype' => 'quantity',
698             'datavalue' => {
699             'type' => 'quantity',
700             'value' => {
701             'amount' => '+0.00000000000000000000000000000091093821500',
702             'upperBound' => '+0.00000000000000000000000000000091093821545',
703             'lowerBound' => '+0.00000000000000000000000000000091093821455',
704             'unit' => 'http://test.wikidata.org/entity/Q213',
705             },
706             },
707             'snaktype' => 'value',
708             'hash' => 'fac57bc5b94714fb2390cce90f58b6a6cf9b9717',
709             'property' => 'P394',
710             },
711             }],
712             },
713             'descriptions' => {
714             'en' => {
715             'language' => 'en',
716             'value' => 'human',
717             },
718             'cs' => {
719             'language' => 'cs',
720             'value' => 'člověk',
721             },
722             },
723             'id' => 'Q42',
724             'labels' => {
725             'en' => {
726             'language' => 'en',
727             'value' => 'Douglas Adams',
728             },
729             'cs' => {
730             'language' => 'cs',
731             'value' => 'Douglas Adams',
732             },
733             },
734             'lastrevid' => 534820,
735             'modified' => '2020-12-02T13:39:18Z',
736             'ns' => 0,
737             'pageid' => '703',
738             'sitelinks' => {
739             'cswiki' => {
740             'title' => 'Douglas Adams',
741             'badges' => [],
742             'site' => 'cswiki',
743             },
744             },
745             'type' => 'item',
746             'title' => 'Q42',
747             };
748              
749             # Get object.
750             my $obj = struct2obj($struct_hr);
751              
752             # Print out.
753             p $obj;
754              
755             # Output:
756             # Wikibase::Datatype::Item {
757             # Parents Mo::Object
758             # public methods (9) : BUILD, can (UNIVERSAL), DOES (UNIVERSAL), err (Error::Pure), check_array_object (Mo::utils), check_number (Mo::utils), check_number_of_items (Mo::utils), isa (UNIVERSAL), VERSION (UNIVERSAL)
759             # private methods (1) : __ANON__ (Mo::build)
760             # internals: {
761             # aliases [
762             # [0] Wikibase::Datatype::Value::Monolingual,
763             # [1] Wikibase::Datatype::Value::Monolingual,
764             # [2] Wikibase::Datatype::Value::Monolingual,
765             # [3] Wikibase::Datatype::Value::Monolingual
766             # ],
767             # descriptions [
768             # [0] Wikibase::Datatype::Value::Monolingual,
769             # [1] Wikibase::Datatype::Value::Monolingual
770             # ],
771             # id "Q42",
772             # labels [
773             # [0] Wikibase::Datatype::Value::Monolingual,
774             # [1] Wikibase::Datatype::Value::Monolingual
775             # ],
776             # lastrevid 534820,
777             # modified "2020-12-02T13:39:18Z",
778             # ns 0,
779             # page_id 703,
780             # sitelinks [
781             # [0] Wikibase::Datatype::Sitelink
782             # ],
783             # statements [
784             # [0] Wikibase::Datatype::Statement
785             # ],
786             # title "Q42"
787             # }
788             # }
789              
790             =head1 DEPENDENCIES
791              
792             L<Error::Pure>,
793             L<Exporter>,
794             L<Readonly>,
795             L<Wikibase::Datatype::Reference>,
796             L<Wikibase::Datatype::Struct::Utils>.
797              
798             =head1 SEE ALSO
799              
800             =over
801              
802             =item L<Wikibase::Datatype::Struct>
803              
804             Wikibase structure serialization.
805              
806             =item L<Wikibase::Datatype::Item>
807              
808             Wikibase item datatype.
809              
810             =back
811              
812             =head1 REPOSITORY
813              
814             L<https://github.com/michal-josef-spacek/Wikibase-Datatype-Struct>
815              
816             =head1 AUTHOR
817              
818             Michal Josef Špaček L<mailto:skim@cpan.org>
819              
820             L<http://skim.cz>
821              
822             =head1 LICENSE AND COPYRIGHT
823              
824             © 2020-2022 Michal Josef Špaček
825              
826             BSD 2-Clause License
827              
828             =head1 VERSION
829              
830             0.09
831              
832             =cut