NAME

MARC::Convert::Wikidata::Object::People - Bibliographic Wikidata object for people defined by MARC record.

SYNOPSIS

use MARC::Convert::Wikidata::Object::People;

my $obj = MARC::Convert::Wikidata::Object::People->new(%params);
my $date_of_birth = $obj->date_of_birth;
my $date_of_death = $obj->date_of_death;
my $external_ids_ar = $obj->external_ids;
my $full_name = $obj->full_name;
my $name = $obj->name;
my $surname = $obj->surname;
my $work_period_start = $obj->work_period_start;
my $work_period_end = $obj->work_period_end;

METHODS

new

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

Constructor.

Returns instance of object.

  • date_of_birth

    Date of birth of people.

    Parameter is string with date. See "check_date" in Mo::utils::Date for more information.

    Default value is undef.

  • date_of_death

    Date of death of people.

    Parameter is string with date. See "check_date" in Mo::utils::Date for more information.

    Default value is undef.

  • external_ids

    External ids.

    Need to be a reference to array with MARC::Convert::Wikidata::Object::ExternalId instances.

    Default value is [].

  • name

    Given name of people.

    Default value is undef.

  • surname

    Surname of people.

    Default value is undef.

date_of_birth

my $date_of_birth = $obj->date_of_birth;

Get date of birth.

Returns string.

date_of_death

my $date_of_death = $obj->date_of_death;

Get date of death.

Returns string.

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.

full_name

my $full_name = $obj->full_name;

Get full name.

Returns string.

name

my $name = $obj->name;

Get given name.

Returns string.

surname

my $surname = $obj->surname;

Get surname.

Returns string.

work_period_start

my $work_period_start = $obj->work_period_start;

Get start date of work period.

Returns string.

work_period_end

my $work_period_end = $obj->work_period_end;

Get end date of work period.

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_date():
                Parameter 'date_of_birth' for date is in bad format.
                Parameter 'date_of_birth' has year greater than actual year.
                Parameter 'date_of_death' for date is in bad format.
                Parameter 'date_of_death' has year greater than actual year.
        From Mo::utils::Date::check_date_order():
                Parameter 'date_of_birth' has date greater or same as parameter 'date_of_death' date.

EXAMPLE1

use strict;
use warnings;

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

my $obj = MARC::Convert::Wikidata::Object::People->new(
        'date_of_birth' => '1952-12-08',
        'external_ids' => [
                MARC::Convert::Wikidata::Object::ExternalId->new(
                        'name' => 'nkcr_aut',
                        'value' => 'jn20000401266',
                ),
        ],
        'name' => decode_utf8('Jiří'),
        'surname' => 'Jurok',
);

p $obj;

# Output:
# MARC::Convert::Wikidata::Object::People  {
#     parents: Mo::Object
#     public methods (4):
#         BUILD
#         Mo::utils:
#             check_array_object
#         Mo::utils::Date:
#             check_date, check_date_order
#     private methods (0)
#     internals: {
#         date_of_birth   "1952-12-08" (dualvar: 1952),
#         external_ids    [
#             [0] MARC::Convert::Wikidata::Object::ExternalId
#         ],
#         name            "Jiří",
#         surname         "Jurok"
#     }
# }

DEPENDENCIES

Mo, Mo::utils, Mo::utils::Date.

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-2024

BSD 2-Clause License

VERSION

0.06