NAME

MARC::Convert::Wikidata::Object::Work - Bibliographic Wikidata object for work defined by MARC record.

SYNOPSIS

use MARC::Convert::Wikidata::Object::Work;

my $obj = MARC::Convert::Wikidata::Object::Work->new(%params);
my $author = $obj->author;
my $external_ids_ar = $obj->external_ids;
my $title = $obj->title;
my $title_language = $obj->title_language;

METHODS

new

my $obj = MARC::Convert::Wikidata::Object::Work->new(%params);

Constructor.

Returns instance of object.

author

my $author = $obj->author;

Get author of work.

Returns MARC::Convert::Wikidata::Object::People instance.

external_ids

my $external_ids_ar = $obj->external_ids;

Get list of external ids.

Returns reference to array with MARC::Convert::Wikidata::Object::ExternalId instances.

title

my $title = $obj->title;

Get work title.

Returns string.

title_language

my $title_language = $obj->title_language;

Get work title language.

Returns string.

ERRORS

new():
        From Mo::utils::check_array_object():
                External id isn't 'MARC::Convert::Wikidata::Object::ExternalId' object.
                        Value: %s
                        Reference: %s
                Parameter 'external_ids' must be a array.
                        Value: %s
                        Reference: %s
        From Mo::utils::Date::check_isa():
                Parameter 'author' must be a 'MARC::Convert::Wikidata::Object::People' object.
                        Value: %s
                        Reference: %s
        From Mo::utils::Date::check_required():
                        Parameter 'title' is required.
                

EXAMPLE1

use strict;
use warnings;

use Data::Printer;
use MARC::Convert::Wikidata::Object::ExternalId;
use MARC::Convert::Wikidata::Object::People;
use MARC::Convert::Wikidata::Object::Work;
use Unicode::UTF8 qw(decode_utf8);

my $obj = MARC::Convert::Wikidata::Object::Work->new(
        'author' => MARC::Convert::Wikidata::Object::People->new(
                'name' => decode_utf8('Tomáš Garrigue'),
                'surname' => 'Masaryk',
        ),
        'external_ids' => [
                MARC::Convert::Wikidata::Object::ExternalId->new(
                        'name' => 'nkcr_aut',
                        'value' => 'jn20000401266',
                ),
        ],
        'title' => decode_utf8('O ethice a alkoholismu'),
        'title_language' => 'cze',
);

p $obj;

# Output:
# MARC::Convert::Wikidata::Object::Work  {
#     parents: Mo::Object
#     public methods (3):
#         BUILD
#         Mo::utils:
#             check_array_object, check_isa
#     private methods (0)
#     internals: {
#         author           MARC::Convert::Wikidata::Object::People,
#         external_ids     [
#             [0] MARC::Convert::Wikidata::Object::ExternalId
#         ],
#         title            "O ethice a alkoholismu",
#         title_language   "cze"
#     }
# }

DEPENDENCIES

Mo, Mo::utils.

SEE ALSO

MARC::Convert::Wikidata

Conversion class between MARC record and Wikidata object.

REPOSITORY

https://github.com/michal-josef-spacek/MARC-Convert-Wikidata-Object

AUTHOR

Michal Josef Špaček mailto:skim@cpan.org

http://skim.cz

LICENSE AND COPYRIGHT

© Michal Josef Špaček 2021-2025

BSD 2-Clause License

VERSION

0.13