NAME

MARC::Convert::Wikidata::Object::PublicationDate - Bibliographic Wikidata object for publication date defined by MARC record.

SYNOPSIS

use MARC::Convert::Wikidata::Object::PublicationDate;

my $obj = MARC::Convert::Wikidata::Object::PublicationDate->new(%params);
my $copyright = $obj->copyright;
my $date = $obj->date;
my $earliest_date = $obj->earliest_date;
my $end_time = $obj->end_time;
my $latest_date = $obj->latest_date;
my $precision = $obj->precision;
my $sourcing_circumstances = $obj->sourcing_circumstances;
my $start_time = $obj->start_time;

DESCRIPTION

The object for store publication date in book editions in the Czech National Library.

Possible scenarios are:

Precise date

We could use 'date' parameter to store publication date.

Precise decade

We could use 'date' and 'precision' parameters to store publication date with precision (e.g. decade 1910s).

Date between

We could use 'earliest_date' and 'latest_date' parameters to store publication date.

Date defined as period of time

We could use 'start_time' and 'end_time' parameters to store publication date. e.g. For book series which one volume is from 'start_time' and last volume from 'end_time' publication date.

Date which is with some accuracy

We could use 'date' and 'sourcing_circumstances' parameters do define accuracy (e.g. circa).

We could use previous versions with 'copyright' parameter.

METHODS

new

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

Constructor.

Returns instance of object.

  • copyright

    Flag, that date is for copyright.

    Default value is 0.

  • date

    Precise date.

    Date is in YYYY-MM-DD, YYYY-M-D, YYYY-MM, YYYY-M or YYYY format.

    The parameter is in conflict with (earliest_date and latest_date) and (start_time and end_time).

    Default value is undef.

  • earliest_date

    Earliest date for definition publication date between dates.

    Date is in YYYY-MM-DD, YYYY-M-D, YYYY-MM, YYYY-M or YYYY format.

    The parameter is in conflict with (date) and (start_time and end_time).

    Default value is undef.

  • end_time

    End date for definition publication date via period of time.

    Date is in YYYY-MM-DD, YYYY-M-D, YYYY-MM, YYYY-M or YYYY format.

    The parameter is in conflict with (date) and (earliest_date and latest_date).

    Default value is undef.

  • latest_date

    Latest date for definition publication date between dates.

    Date is in YYYY-MM-DD, YYYY-M-D, YYYY-MM, YYYY-M or YYYY format.

    The parameter is in conflict with (date) and (start_time and end_time).

    Default value is undef.

  • precision

    Precision for date.

    Possible values are:

    • day (default if 'date' present)

    • month

    • year

    • decade

    • century

    • millenium

  • sourcing_circumstances

    Sourcing circumstances string.

    Possible values are:

    • circa

    • near

    • presumably

    • disputed

  • start_time

    Start date for definition publication date via period of time.

    Date is in YYYY-MM-DD, YYYY-M-D, YYYY-MM, YYYY-M or YYYY format.

    The parameter is in conflict with (date) and (earliest_date and latest_date).

    Default value is undef.

my $copyright = $obj->copyright;

Get copyright flag.

Returns 0/1.

date

my $date = $obj->date;

Get date.

Returns string.

earliest_date

my $earliest_date = $obj->earliest_date;

Get earlest date.

Returns string.

end_time

my $end_time = $obj->end_time;

Get end time.

Returns string.

latest_date

my $latest_date = $obj->latest_date;

Get latest date.

Returns string.

precision

my $precision = $obj->precision;

Get date precision.

Returns string.

sourcing_circumstances

my $sourcing_circumstances = $obj->sourcing_circumstances;

Get sourcing circumstances string.

Returns string.

start_time

my $start_time = $obj->start_time;

Get start time.

Returns string.

ERRORS

new():
        From Mo::utils::check_bool():
                Parameter 'copyright' must be a bool (0/1).
                        Value: %s
        From Mo::utils::check_strings():
                Parameter 'precision' must have strings definition.
                Parameter 'precision' must have right string definition.
                Parameter 'precision' must be one of defined strings.
                        String: %s
                        Possible strings: %s
                Parameter 'sourcing_circumstances' must have strings definition.
                Parameter 'sourcing_circumstances' must have right string definition.
                Parameter 'sourcing_circumstances' must be one of defined strings.
                        String: %s
                        Possible strings: %s
        From Mo::utils::Date::check_date():
                Parameter 'date' for date is in bad format.
                        Value: %s
                Parameter 'date' has year greater than actual year.
                Parameter 'earliest_date' for date is in bad format.
                        Value: %s
                Parameter 'earliest_date' has year greater than actual year.
                Parameter 'end_time' for date is in bad format.
                        Value: %s
                Parameter 'end_time' has year greater than actual year.
                Parameter 'start_time' for date is in bad format.
                        Value: %s
                Parameter 'start_time' has year greater than actual year.
        Parameter 'date' is in conflict with parameter 'earliest_date'.
        Parameter 'date' is in conflict with parameter 'latest_date'.
        Parameter 'date' is in conflict with parameter 'start_time'.
        Parameter 'date' is in conflict with parameter 'end_time'.
        Parameter 'earliest_date' is in conflict with parameter 'start_time'.
        Parameter 'earliest_date' is in conflict with parameter 'end_time'.
        Parameter 'latest_date' is in conflict with parameter 'start_time'.
        Parameter 'latest_date' is in conflict with parameter 'end_time'.
        Parameter 'precision' is in conflict with parameter 'earliest_date'.
        Parameter 'precision' is in conflict with parameter 'latest_date'.
        Parameter 'precision' is in conflict with parameter 'start_time'.
        Parameter 'precision' is in conflict with parameter 'end_time'.

EXAMPLE1

use strict;
use warnings;

use Data::Printer;
use MARC::Convert::Wikidata::Object::PublicationDate;

my $obj = MARC::Convert::Wikidata::Object::PublicationDate->new(
        'date' => '2014',
);

p $obj;

# Output:
# MARC::Convert::Wikidata::Object::PublicationDate  {
#     parents: Mo::Object
#     public methods (5):
#         BUILD
#         Error::Pure:
#             err
#         Mo::utils:
#             check_bool, check_strings
#         Readonly:
#             Readonly
#     private methods (1): _check_conflict
#     internals: {
#         date   2014
#     }
# }

EXAMPLE2

use strict;
use warnings;

use Data::Printer;
use MARC::Convert::Wikidata::Object::PublicationDate;

my $obj = MARC::Convert::Wikidata::Object::PublicationDate->new(
        'earliest_date' => '2014',
        'latest_date' => '2020',
);

p $obj;

# Output:
# MARC::Convert::Wikidata::Object::PublicationDate  {
#     parents: Mo::Object
#     public methods (5):
#         BUILD
#         Error::Pure:
#             err
#         Mo::utils:
#             check_bool, check_strings
#         Readonly:
#             Readonly
#     private methods (1): _check_conflict
#     internals: {
#         earliest_date   2014,
#         latest_date     2020
#     }
# }

EXAMPLE3

use strict;
use warnings;

use Data::Printer;
use MARC::Convert::Wikidata::Object::PublicationDate;

my $obj = MARC::Convert::Wikidata::Object::PublicationDate->new(
        'start_time' => '2014',
        'end_time' => '2020',
);

p $obj;

# Output:
# MARC::Convert::Wikidata::Object::PublicationDate  {
#     parents: Mo::Object
#     public methods (5):
#         BUILD
#         Error::Pure:
#             err
#         Mo::utils:
#             check_bool, check_strings
#         Readonly:
#             Readonly
#     private methods (1): _check_conflict
#     internals: {
#         end_time     2020,
#         start_time   2014
#     }
# }

EXAMPLE4

use strict;
use warnings;

use Data::Printer;
use MARC::Convert::Wikidata::Object::PublicationDate;

my $obj = MARC::Convert::Wikidata::Object::PublicationDate->new(
        'date' => '2014',
        'sourcing_circumstances' => 'circa',
);

p $obj;

# Output:
# MARC::Convert::Wikidata::Object::PublicationDate  {
#     parents: Mo::Object
#     public methods (5):
#         BUILD
#         Error::Pure:
#             err
#         Mo::utils:
#             check_bool, check_strings
#         Readonly:
#             Readonly
#     private methods (1): _check_conflict
#     internals: {
#         date                     2014,
#         sourcing_circumstances   "circa"
#     }
# }

EXAMPLE5

use strict;
use warnings;

use Data::Printer;
use MARC::Convert::Wikidata::Object::PublicationDate;

my $obj = MARC::Convert::Wikidata::Object::PublicationDate->new(
        'copyright' => 1,
        'date' => '2014',
);

p $obj;

# Output:
# MARC::Convert::Wikidata::Object::PublicationDate  {
#     parents: Mo::Object
#     public methods (5):
#         BUILD
#         Error::Pure:
#             err
#         Mo::utils:
#             check_bool, check_strings
#         Readonly:
#             Readonly
#     private methods (1): _check_conflict
#     internals: {
#         copyright   1,
#         date        2014
#     }
# }

DEPENDENCIES

Error::Pure, Mo, Mo::utils, Mo::utils::Date, Readonly.

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.07