Object.pm

filter: Statementstmt 96.8% 91 / 94 Branchbran 50.0% 2 / 4 Conditioncond 50.0% 3 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 91.6% 11 / 12 Podpod 50.0% 1 / 2 totaltotal 88.5% 108 / 122 CC 7 SCAR 10.6
CC
7
Cov
92%
BUILD
6.2
full_name
2.0
__ANON__
1.2
CRAP 2.9
« Object/Series.pm ↑ Summary Object/PublicationDate.pm »
1 package MARC::Convert::Wikidata::Object;
2  
3 32 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 32 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 32 ▶use Error::Pure qw(err);
Subroutine BEGIN: called CC=1 SCAR=0.0
7 32 ▶use List::Util 1.33 qw(none);
Subroutine BEGIN: called CC=1 SCAR=0.0
8 32 ▶use Mo qw(build default is);
Subroutine BEGIN: called CC=1 SCAR=0.0
9 32 ▶use Mo::utils 0.26 qw(check_isa check_number);
Subroutine BEGIN: called CC=1 SCAR=0.0
10 32 ▶use Mo::utils::Array qw(check_array check_array_object);
Subroutine BEGIN: called CC=1 SCAR=0.0
11 32 ▶use Readonly;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 32 Readonly::Array our @COVERS => qw(hardback paperback);
14  
15 32 our $VERSION = 0.15;
16  
17 32 has authors => (
18 default => [],
19 is => 'ro',
20 );
21  
22 32 has authors_of_afterword => (
23 default => [],
24 is => 'ro',
25 );
26  
27 32 has authors_of_introduction => (
28 default => [],
29 is => 'ro',
30 );
31  
32 32 has compilers => (
33 default => [],
34 is => 'ro',
35 );
36  
37 32 has cover => (
38 is => 'ro',
39 );
40  
41 32 has covers => (
42 default => [],
43 is => 'ro',
44 );
45  
46 32 has cycles => (
47 default => [],
48 is => 'ro',
49 );
50  
51 32 has directors => (
52 default => [],
53 is => 'ro',
54 );
55  
56 32 has dml => (
57 is => 'ro',
58 );
59  
60 32 has edition_number => (
61 is => 'ro',
62 );
63  
64 32 has edition_of_work => (
65 is => 'ro',
66 );
67  
68 32 has editors => (
69 default => [],
70 is => 'ro',
71 );
72  
73 32 has end_time => (
74 is => 'ro',
75 );
76  
77 32 has external_ids => (
78 default => [],
79 is => 'ro',
80 );
81  
82 32 has illustrators => (
83 default => [],
84 is => 'ro',
85 );
86  
87 32 has isbns => (
88 default => [],
89 is => 'ro',
90 );
91  
92 32 has issn => (
93 is => 'ro',
94 );
95  
96 32 has languages => (
97 default => [],
98 is => 'ro',
99 );
100  
101 32 has krameriuses => (
102 default => [],
103 is => 'ro',
104 );
105  
106 32 has narrators => (
107 default => [],
108 is => 'ro',
109 );
110  
111 32 has number_of_pages => (
112 is => 'ro',
113 );
114  
115 32 has photographers => (
116 default => [],
117 is => 'ro',
118 );
119  
120 32 has publication_date => (
121 is => 'ro',
122 );
123  
124 32 has publishers => (
125 default => [],
126 is => 'ro',
127 );
128  
129 32 has series => (
130 default => [],
131 is => 'ro',
132 );
133  
134 32 has start_time => (
135 is => 'ro',
136 );
137  
138 32 has subtitles => (
139 default => [],
140 is => 'ro',
141 );
142  
143 32 has title => (
144 is => 'ro',
145 );
146  
147 32 has translators => (
148 default => [],
149 is => 'ro',
150 );
151  
152 sub full_name {
153 4 ▶ my $self = shift;
Subroutine full_name: called CC=2 SCAR=6.9
Pod documented
154  
155 4 my $full_name = $self->title;
156 4 foreach my $subtitle (@{$self->subtitles}) {
157 3 $full_name .= ': '.$subtitle;
158 }
159  
160 4 return $full_name;
161 }
162  
163 sub BUILD {
164 65 ▶ my $self = shift;
Subroutine BUILD: called CC=6 SCAR=18.3
Pod undocumented
165  
166 # Check 'authors'.
167 65 check_array_object($self, 'authors', 'MARC::Convert::Wikidata::Object::People');
168  
169 # Check 'authors_of_introduction'.
170 65 check_array_object($self, 'authors_of_afterword', 'MARC::Convert::Wikidata::Object::People');
171  
172 # Check 'authors_of_introduction'.
173 65 check_array_object($self, 'authors_of_introduction', 'MARC::Convert::Wikidata::Object::People');
174  
175 # Check 'compilers'.
176 65 check_array_object($self, 'compilers', 'MARC::Convert::Wikidata::Object::People');
177  
178 # Check 'cover'.
179 65 ▶ if (defined $self->{'cover'} && none { $_ eq $self->{'cover'} } @COVERS) {
Subroutine __ANON__: called CC=1 SCAR=0.2
Branch: 1 branch
BranchTrueFalseTotal
if (defined $self->{"cover"} and &none(sub { $_ eq $self->{"cover"}; } , @MARC::Convert::Wikidata::Object::COVERS)) 0 65 65
Condition66%2/3
defined $self->{"cover"} and &none(sub {
!ll&&!rl&&r
6410
MC/DC0%0/2
defined $self->{"cover"} and &none(sub { $_ eq $self->{"cover"}; } , @MARC::Convert::Wikidata::Object::COVERS)
defined $self->{"cover"} &none(sub { $_ eq $self->{"cover"}; } , @MARC::Convert::Wikidata::Object::COVERS)
Truth table66%2/3
A and B
A= defined $self->{"cover"}B= &none(sub { $_ eq $self->{"cover"}; } , @MARC::Convert::Wikidata::Object::COVERS)
ABresult
0X0
100
111
180 0 err "Book cover '".$self->{'cover'}."' doesn't exist.";
181 }
182  
183 # Check 'covers'.
184 # XXX Common check.
185 65 foreach my $cover (@{$self->covers}) {
186 2 ▶ if (! defined $cover && none { $_ eq $cover } @COVERS) {
Subroutine __ANON__: not called CC=1 SCAR=1.7
Branch: 1 branch
BranchTrueFalseTotal
if (not defined $cover and &none(sub { $_ eq $cover; } , @MARC::Convert::Wikidata::Object::COVERS)) 0 2 2
Condition33%1/3
not defined $cover and &none(sub {
!ll&&!rl&&r
200
MC/DC0%0/2
not defined $cover and &none(sub { $_ eq $cover; } , @MARC::Convert::Wikidata::Object::COVERS)
not defined $cover &none(sub { $_ eq $cover; } , @MARC::Convert::Wikidata::Object::COVERS)
Truth table33%1/3
not(A) and B
A= not defined $coverB= &none(sub { $_ eq $cover; } , @MARC::Convert::Wikidata::Object::COVERS)
ABresult
0X0
100
111
187 0 err "Book cover '".$cover."' doesn't exist.";
188 }
189 }
190  
191 # Check 'cycles'.
192 65 check_array_object($self, 'cycles', 'MARC::Convert::Wikidata::Object::Series');
193  
194 # Check 'directors'.
195 65 check_array_object($self, 'directors', 'MARC::Convert::Wikidata::Object::People');
196  
197 # Check 'dml',
198 65 check_number($self, 'dml');
199  
200 # Check 'edition_of_work'.
201 65 check_isa($self, 'edition_of_work', 'MARC::Convert::Wikidata::Object::Work');
202  
203 # Check 'editors'.
204 65 check_array_object($self, 'editors', 'MARC::Convert::Wikidata::Object::People');
205  
206 # Check 'end_time'.
207 65 check_number($self, 'end_time');
208  
209 # Check 'external_ids'.
210 65 check_array_object($self, 'external_ids', 'MARC::Convert::Wikidata::Object::ExternalId');
211  
212 # Check 'illustrators'.
213 65 check_array_object($self, 'illustrators', 'MARC::Convert::Wikidata::Object::People');
214  
215 # Check 'isbns'.
216 65 check_array_object($self, 'isbns', 'MARC::Convert::Wikidata::Object::ISBN');
217  
218 # Check 'languages'.
219 65 check_array($self, 'languages');
220  
221 # Check 'krameriues'.
222 65 check_array_object($self, 'krameriuses', 'MARC::Convert::Wikidata::Object::Kramerius');
223  
224 # Check 'narrators'.
225 65 check_array_object($self, 'narrators', 'MARC::Convert::Wikidata::Object::People');
226  
227 # Check 'photographers'.
228 65 check_array_object($self, 'photographers', 'MARC::Convert::Wikidata::Object::People');
229  
230 # Check 'publishers'.
231 65 check_array_object($self, 'publishers', 'MARC::Convert::Wikidata::Object::Publisher');
232  
233 # Check 'series'.
234 65 check_array_object($self, 'series', 'MARC::Convert::Wikidata::Object::Series');
235  
236 # Check 'start_time'.
237 65 check_number($self, 'start_time');
238  
239 # Check 'subtitles'.
240 65 check_array($self, 'subtitles');
241  
242 # Check 'translators'.
243 65 check_array_object($self, 'translators',
244 'MARC::Convert::Wikidata::Object::People', 'Translator');
245  
246 65 return;
247 }
248  
249 32 1;
250  
251 __END__
252  
253 =pod
254  
255 =encoding utf8
256  
257 =head1 NAME
258  
259 MARC::Convert::Wikidata::Object - Bibliographic Wikidata object defined by MARC record.
260  
261 =head1 SYNOPSIS
262  
263 use MARC::Convert::Wikidata::Object;
264  
265 my $obj = MARC::Convert::Wikidata::Object->new(%params);
266 my $authors_ar = $obj->authors;
267 my $authors_of_afterword_ar = $obj->authors_of_afterword;
268 my $authors_of_introduction_ar = $obj->authors_of_introduction;
269 my $compilers = $obj->compilers;
270 my $cover = $obj->cover;
271 my $covers_ar = $obj->covers;
272 my $cycles_ar = $obj->cycles;
273 my $directors_ar = $obj->directors;
274 my $dml = $obj->dml;
275 my $edition_number = $obj->edition_number;
276 my $edition_of_work = $obj->edition_of_work;
277 my $editors_ar = $obj->editors;
278 my $end_time = $obj->end_time;
279 my $external_ids_ar = $obj->external_ids;
280 my $full_name = $obj->full_name;
281 my $illustrators_ar = $obj->illustrators;
282 my $isbns_ar = $obj->isbns;
283 my $issn = $obj->issn;
284 my $kramerius_ar = $obj->krameriuses;
285 my $languages_ar = $obj->languages;
286 my $narrators_ar = $obj->narrators;
287 my $number_of_pages = $obj->number_of_pages;
288 my $photographers_ar = $obj->photographers;
289 my $publication_date = $obj->publication_date;
290 my $publishers_ar = $obj->publishers;
291 my $series_ar = $obj->series;
292 my $start_time = $obj->start_time;
293 my $subtitles_ar = $obj->subtitles;
294 my $title = $obj->title;
295 my $translators_ar = $obj->translators;
296  
297 =head1 METHODS
298  
299 =head2 C<new>
300  
301 my $obj = MARC::Convert::Wikidata::Object->new(%params);
302  
303 Constructor.
304  
305 Returns instance of object.
306  
307 =over 8
308  
309 =item * C<authors>
310  
311 List of authors.
312 Reference to array with MARC::Convert::Wikidata::Object::People instances.
313  
314 Default value is reference to blank array.
315  
316 =item * C<authors_of_afterword>
317  
318 List of authors of afterword.
319 Reference to array with MARC::Convert::Wikidata::Object::People instances.
320  
321 Default value is reference to blank array.
322  
323 =item * C<authors_of_introduction>
324  
325 List of authors of introduction.
326 Reference to array with MARC::Convert::Wikidata::Object::People instances.
327  
328 Default value is reference to blank array.
329  
330 =item * C<compilers>
331  
332 List of compilers.
333 Reference to array with MARC::Convert::Wikidata::Object::People instances.
334  
335 Default value is reference to blank array.
336  
337 =item * C<cover>
338  
339 I<Parameter is deprecated. Use L<covers> instead of it.>
340  
341 Book cover.
342 Possible values:
343 * hardback
344 * paperback
345  
346 Default value is undef.
347  
348 =item * C<covers>
349  
350 Book covers.
351  
352 It's reference to array with 'hardback', 'paperback' values.
353  
354 Default value is [].
355  
356 =item * C<cycles>
357  
358 List of book cycles.
359 Reference to array with MARC::Convert::Wikidata::Object::Series instances.
360  
361 Default value is [].
362  
363 =item * C<directors>
364  
365 List of directors.
366 Reference to array with MARC::Convert::Wikidata::Object::People instances.
367  
368 Default value is reference to blank array.
369  
370 =item * C<dml>
371  
372 DML id.
373  
374 Default value is undef.
375  
376 =item * C<edition_number>
377  
378 Edition number.
379  
380 Default value is undef.
381  
382 =item * C<edition_of_work>
383  
384 Edition of work.
385  
386 Default value is undef.
387  
388 =item * C<editors>
389  
390 List of editors.
391 Reference to array with MARC::Convert::Wikidata::Object::People instances.
392  
393 Default value is reference to blank array.
394  
395 =item * C<end_time>
396  
397 End time.
398  
399 Default value is undef.
400  
401 =item * C<external_ids>
402  
403 External ids.
404  
405 Need to be a reference to array with L<MARC::Convert::Wikidata::Object::ExternalId> instances.
406  
407 Default value is [].
408  
409 =item * C<illustrators>
410  
411 List of illustrators.
412 Reference to array with MARC::Convert::Wikidata::Object::People instances.
413  
414 Default value is reference to blank array.
415  
416 =item * C<isbns>
417  
418 List of ISBNs.
419 Reference to array with MARC::Convert::Wikidata::Object::ISBN instances.
420  
421 Default value is reference to blank array.
422  
423 =item * C<issn>
424  
425 ISSN number.
426  
427 Default value is undef.
428  
429 =item * C<krameriuses>
430  
431 List of Kramerius systems with digitized scan.
432 Reference to array with MARC::Convert::Wikidata::Object::Kramerius instances.
433  
434 Default value is reference to blank array.
435  
436 =item * C<languages>
437  
438 List of languages of book edition (TODO Format)
439  
440 Default value is reference to blank array.
441  
442 =item * C<narrators>
443  
444 List of narrators.
445 Reference to array with MARC::Convert::Wikidata::Object::People instances.
446  
447 Default value is reference to blank array.
448  
449 =item * C<number_of_pages>
450  
451 Number of pages.
452  
453 Default value is undef.
454  
455 =item * C<photographers>
456  
457 List of photographers.
458 Reference to array with MARC::Convert::Wikidata::Object::People instances.
459  
460 Default value is reference to blank array.
461  
462 =item * C<publication_date>
463  
464 Publication date.
465  
466 Default value is undef.
467  
468 =item * C<publishers>
469  
470 List of Publishers.
471 Reference to array with MARC::Convert::Wikidata::Object::Publisher instances.
472  
473 Default value is [].
474  
475 =item * C<series>
476  
477 List of book series.
478 Reference to array with MARC::Convert::Wikidata::Object::Series instances.
479  
480 Default value is [].
481  
482 =item * C<start_time>
483  
484 Start time.
485  
486 Default value is undef.
487  
488 =item * C<subtitles>
489  
490 List of subtitles.
491 Reference to array with strings.
492  
493 Default value is [].
494  
495 =item * C<title>
496  
497 Title of book edition.
498  
499 Default value is undef.
500  
501 =item * C<translators>
502  
503 List of translators.
504 Reference to array with MARC::Convert::Wikidata::Object::People instances.
505  
506 Default value is reference to blank array.
507  
508 =back
509  
510 =head2 C<authors>
511  
512 my $authors_ar = $obj->authors;
513  
514 Get reference to array with author objects.
515  
516 Returns reference to array of MARC::Convert::Wikidata::Object::People instances.
517  
518 =head2 C<authors_of_afterword>
519  
520 my $authors_of_afterword_ar = $obj->authors_of_afterword;
521  
522 Get reference to array with author of afterword objects.
523  
524 Returns reference to array of MARC::Convert::Wikidata::Object::People instances.
525  
526 =head2 C<authors_of_introduction>
527  
528 my $authors_of_introduction_ar = $obj->authors_of_introduction;
529  
530 Get reference to array with author of introduction objects.
531  
532 Returns reference to array of MARC::Convert::Wikidata::Object::People instances.
533  
534 =head2 C<compilers>
535  
536 my $compilers_ar = $obj->compilers;
537  
538 Get list of compilers.
539  
540 Returns reference to array of MARC::Convert::Wikidata::Object::People instances.
541  
542 =head2 C<cover>
543  
544 my $cover = $obj->cover;
545  
546 Get book cover.
547  
548 Returns string (hardback or paperback).
549  
550 =head2 C<covers>
551  
552 my $covers_ar = $obj->covers;
553  
554 Get book covers.
555  
556 Returns reference to array with cover strings.
557  
558 =head2 C<cycles>
559  
560 my $cycles_ar = $obj->cycles;
561  
562 Get reference to array with Serie item objects.
563  
564 Returns reference to array of MARC::Convert::Wikidata::Object::Series instances.
565  
566 =head2 C<directors>
567  
568 my $directors_ar = $obj->directors;
569  
570 Get list of directors.
571  
572 Returns reference to array of MARC::Convert::Wikidata::Object::People instances.
573  
574 =head2 C<dml>
575  
576 my $dml = $obj->dml;
577  
578 Get DML id.
579  
580 Returns number.
581  
582 =head2 C<edition_number>
583  
584 my $edition_number = $obj->edition_number;
585  
586 Get edition number.
587  
588 Returns number.
589  
590 =head2 C<edition_of_work>
591  
592 my $edition_of_work = $obj->edition_of_work;
593  
594 Get edition of work.
595  
596 Returns L<MARC::Convert::Wikidata::Object::Work> instance.
597  
598 =head2 C<editors>
599  
600 my $editors_ar = $obj->editors;
601  
602 Get list of editors.
603  
604 Returns reference to array of MARC::Convert::Wikidata::Object::People instances.
605  
606 =head2 C<end_time>
607  
608 my $end_time = $obj->end_time;
609  
610 Get end time.
611  
612 Returns number.
613  
614 =head2 C<external_ids>
615  
616 my $external_ids_ar = $obj->external_ids;
617  
618 Get list of external ids.
619  
620 Returns reference to array with L<MARC::Convert::Wikidata::Object::ExternalId> instances.
621  
622 =head2 C<full_name>
623  
624 my $full_name = $obj->full_name;
625  
626 Get full name of edition in format '__TITLE__: __SUBTITLE__'.
627  
628 Returns string.
629  
630 =head2 C<illustrators>
631  
632 my $illustrators_ar = $obj->illustrators;
633  
634 Get list of illustrators.
635  
636 Returns reference to array of MARC::Convert::Wikidata::Object::People instances.
637  
638 =head2 C<isbns>
639  
640 my $isbns_ar = $obj->isbns;
641  
642 Get list of ISBNs.
643  
644 Returns reference to array of MARC::Convert::Wikidata::Object::ISBN instances.
645  
646 =head2 C<issn>
647  
648 my $issn = $obj->issn;
649  
650 Get ISSN number.
651  
652 Returns string.
653  
654 =head2 c<krameriuses>
655  
656 my $kramerius_ar = $obj->krameriuses;
657  
658 Get reference to array with Kramerius item objects.
659  
660 Returns reference to array of MARC::Convert::Wikidata::Object::Kramerius instances.
661  
662 =head2 C<languages>
663  
664 my $languages_ar = $obj->languages;
665  
666 TODO
667  
668 =head2 C<narrators>
669  
670 my $narrators_ar = $obj->narrators;
671  
672 Get list of narrators.
673  
674 Returns reference to array of MARC::Convert::Wikidata::Object::People instances.
675  
676 =head2 C<number_of_pages>
677  
678 my $number_of_pages = $obj->number_of_pages;
679  
680 TODO
681  
682 =head2 C<photographers>
683  
684 my $photographers_ar = $obj->photographers;
685  
686 Get reference to array with photographers objects.
687  
688 Returns reference to array of MARC::Convert::Wikidata::Object::People instances.
689  
690 =head2 C<publication_date>
691  
692 my $publication_date = $obj->publication_date;
693  
694 TODO
695  
696 =head2 C<publishers>
697  
698 my $publishers_ar = $obj->publishers;
699  
700 Get list of publishing houses.
701  
702 Returns reference to array of MARC::Convert::Wikidata::Object::Publisher instances.
703  
704 =head2 C<series>
705  
706 my $series_ar = $obj->series;
707  
708 Get reference to array with Serie item objects.
709  
710 Returns reference to array of MARC::Convert::Wikidata::Object::Series instances.
711  
712 =head2 C<start_time>
713  
714 my $start_time = $obj->start_time;
715  
716 Get start time.
717  
718 Returns number.
719  
720 =head2 C<subtitle>
721  
722 my $subtitles_ar = $obj->subtitles;
723  
724 Get reference to array with subtitles.
725  
726 Returns reference to array of strings.
727  
728 =head2 C<title>
729  
730 my $title = $obj->title;
731  
732 Get title.
733  
734 Returns string.
735  
736 =head2 C<translators>
737  
738 my $translators_ar = $obj->translators;
739  
740 Get list of translators.
741  
742 Returns reference to array of MARC::Convert::Wikidata::Object::People instances.
743  
744 =head1 ERRORS
745  
746 new():
747 Book cover '%s' doesn't exist.
748 Parameter 'end_time' must be a number.
749 Parameter 'start_time' must be a number.
750 From Mo::utils::check_isa():
751 Parameter 'edition_of_work' must be a 'MARC::Convert::Wikidata::Object::Work' object.
752 Value: %s
753 Reference: %s
754  
755 From Mo::utils::check_number():
756 Parameter '%s' must a number.
757 Value: %s
758  
759 From Mo::utils::Array::check_array():
760 Parameter 'languages' must be a array.
761 Value: %s
762 Reference: %s
763 Parameter 'subtitles' must be a array.
764 Value: %s
765 Reference: %s
766  
767 From Mo::utils::Array::check_array_object():
768 Parameter 'authors' must be a array.
769 Parameter 'authors' with array must contain 'MARC::Convert::Wikidata::Object::People' objects.
770 Parameter 'authors_of_afterword' must be a array.
771 Parameter 'authors_of_afterword' with array must contain 'MARC::Convert::Wikidata::Object::People' objects.
772 Parameter 'authors_of_introduction' must be a array.
773 Parameter 'authors_of_introduction' with array must contain 'MARC::Convert::Wikidata::Object::People' objects.
774 Parameter 'compilers' must be a array.
775 Parameter 'compilers' with array must contain 'MARC::Convert::Wikidata::Object::People' objects.
776 Parameter 'cycles' must be a array.
777 Parameter 'cycles' with array must contain 'MARC::Convert::Wikidata::Object::Series' objects.
778 Parameter 'directors' must be a array.
779 Parameter 'directors' with array must contain 'MARC::Convert::Wikidata::Object::People' objects.
780 Parameter 'editors' must be a array.
781 Parameter 'editors' with array must contain 'MARC::Convert::Wikidata::Object::People' objects.
782 Parameter 'external_ids' must be a array.
783 Parameter 'external_ids' with array must contain 'MARC::Convert::Wikidata::Object::ExternalId' objects.
784 Parameter 'illustrators' must be a array.
785 Parameter 'illustrators' with array must contain 'MARC::Convert::Wikidata::Object::People' objects.
786 Parameter 'narrators' must be a array.
787 Parameter 'narrators' with array must contain 'MARC::Convert::Wikidata::Object::People' objects.
788 Parameter 'publishers' must be a array.
789 Parameter 'publishers' with array must contain 'MARC::Convert::Wikidata::Object::Publisher' objects.
790 Parameter 'series' must be a array.
791 Parameter 'series' with array must contain 'MARC::Convert::Wikidata::Object::Series' objects.
792 Parameter 'translators' must be a array.
793 Parameter 'translators' with array must contain 'MARC::Convert::Wikidata::Object::People' objects.
794  
795 =head1 EXAMPLE1
796  
797 =for comment filename=create_and_dump_wikidata_object.pl
798  
799 use strict;
800 use warnings;
801  
802 use Data::Printer;
803 use MARC::Convert::Wikidata::Object;
804 use MARC::Convert::Wikidata::Object::ExternalId;
805 use MARC::Convert::Wikidata::Object::ISBN;
806 use MARC::Convert::Wikidata::Object::People;
807 use MARC::Convert::Wikidata::Object::Publisher;
808 use MARC::Convert::Wikidata::Object::Work;
809 use Unicode::UTF8 qw(decode_utf8);
810
811 my $aut = MARC::Convert::Wikidata::Object::People->new(
812 'date_of_birth' => '1952-12-08',
813 'external_ids' => [
814 MARC::Convert::Wikidata::Object::ExternalId->new(
815 'name' => 'nkcr_aut',
816 'value' => 'jn20000401266',
817 ),
818 ],
819 'name' => decode_utf8('Jiří'),
820 'surname' => 'Jurok',
821 );
822  
823 my $publisher = MARC::Convert::Wikidata::Object::Publisher->new(
824 'name' => decode_utf8('Město Příbor'),
825 'place' => decode_utf8('Příbor'),
826 );
827  
828 my $isbn = MARC::Convert::Wikidata::Object::ISBN->new(
829 'isbn' => '80-238-9541-9',
830 'publisher' => $publisher,
831 );
832  
833 my $obj = MARC::Convert::Wikidata::Object->new(
834 'authors' => [$aut],
835 'date_of_publication' => 2002,
836 'edition_number' => 2,
837 'edition_of_work' => MARC::Convert::Wikidata::Object::Work->new(
838 'title' => decode_utf8('Dějiny města Příbora'),
839 'title_language' => 'cze',
840 ),
841 'external_ids' => [
842 MARC::Convert::Wikidata::Object::ExternalId->new(
843 'name' => 'cnb',
844 'value' => 'cnb001188266',
845 ),
846 MARC::Convert::Wikidata::Object::ExternalId->new(
847 'name' => 'lccn',
848 'value' => '53860313',
849 ),
850 ],
851 'isbns' => [$isbn],
852 'number_of_pages' => 414,
853 'publishers' => [$publisher],
854 'title' => decode_utf8('Dějiny města Příbora'),
855 );
856
857 p $obj;
858  
859 # Output:
860 # MARC::Convert::Wikidata::Object {
861 # parents: Mo::Object
862 # public methods (9):
863 # BUILD, full_name
864 # Error::Pure:
865 # err
866 # List::Util:
867 # none
868 # Mo::utils:
869 # check_isa, check_number
870 # Mo::utils::Array:
871 # check_array, check_array_object
872 # Readonly:
873 # Readonly
874 # private methods (0)
875 # internals: {
876 # authors [
877 # [0] MARC::Convert::Wikidata::Object::People
878 # ],
879 # covers [],
880 # date_of_publication 2002,
881 # edition_number 2,
882 # edition_of_work MARC::Convert::Wikidata::Object::Work,
883 # external_ids [
884 # [0] MARC::Convert::Wikidata::Object::ExternalId,
885 # [1] MARC::Convert::Wikidata::Object::ExternalId
886 # ],
887 # isbns [
888 # [0] MARC::Convert::Wikidata::Object::ISBN
889 # ],
890 # number_of_pages 414,
891 # publishers [
892 # [0] MARC::Convert::Wikidata::Object::Publisher
893 # ],
894 # title "Dějiny města Příbora"
895 # }
896 # }
897  
898 =head1 DEPENDENCIES
899  
900 L<Error::Pure>,
901 L<List::Util>,
902 L<Mo>,
903 L<Mo::utils>,
904 L<Mo::utils::Array>,
905 L<Readonly>.
906  
907 =head1 SEE ALSO
908  
909 =over
910  
911 =item L<MARC::Convert::Wikidata>
912  
913 Conversion class between MARC record and Wikidata object.
914  
915 =back
916  
917 =head1 REPOSITORY
918  
919 L<https://github.com/michal-josef-spacek/MARC-Convert-Wikidata-Object>
920  
921 =head1 AUTHOR
922  
923 Michal Josef Špaček L<mailto:skim@cpan.org>
924  
925 L<http://skim.cz>
926  
927 =head1 LICENSE AND COPYRIGHT
928  
929 © Michal Josef Špaček 2021-2025
930  
931 BSD 2-Clause License
932  
933 =head1 VERSION
934  
935 0.15
936  
937 =cut
« Object/Series.pm ↑ Summary Object/PublicationDate.pm »