The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

MARC::Convert::Wikidata - Conversion class between MARC file to Wikibase::Datatype item.

SYNOPSIS

 use MARC::Convert::Wikidata;

 my $obj = MARC::Convert::Wikidata->new(%params);
 my $object = $obj->object;
 my $type = $obj->type;
 my $wikidata = $obj->wikidata;

DESCRIPTION

Original intent of this class was conversion from MARC records in National Library of the Czech Republic to Wikidata. The conversion is not simple, this mean that many things are concrete for this concrete national library.

METHODS

new

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

Constructor.

  • callback_cover

    Cover callback

    Default value is undef.

  • callback_lang

    Language callback.

    Default value is undef.

  • callback_people

    People callback.

    Default value is undef.

  • callback_publisher_place

    Place of publication Wikidata lookup callback.

    Default value is undef.

  • callback_publisher_name

    Publisher Wikidata lookup callback.

    Default value is undef.

  • callback_series

    Book series Wikidata lookup callback.

    Default value is undef.

  • date_retrieved

    Retrieved date.

    Default value is undef.

  • marc_record

    MARC::Record object.

    It's required.

Returns instance of object.

object

 my $object = $obj->object;

Get data object created from MARC record.

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

type

 my $type = $obj->type;

Process MARC record and detect which record type is. Supported values are: monograph, audiobook and periodical.

Returns string.

wikidata

 my $wikidata = $obj->wikidata;

Process conversion from MARC record to Wikibase::Datatype::Item which is possible to load to Wikidata.

Returns Wikibase::Datatype instance.

ERRORS

 new():
         From Class::Utils::set_params():
                 Unknown parameter '%s'.
         Parameter 'marc_record' is required.
         Parameter 'marc_record' must be a MARC::Record object.

 type():
         Unsupported item with leader '%s'.

 wikidata():
         Item '%s' doesn't supported.
         Unsupported item with leader '%s'.

EXAMPLE

 use strict;
 use warnings;

 use File::Temp;
 use MARC::Convert::Wikidata;

 # Object.
 my $obj = MARC::Convert::Wikidata->new;

 # TODO

 # Output like:
 # TODO

DEPENDENCIES

Class::Utils, Error::Pure, MARC::Convert::Wikidata::Item::AudioBook, MARC::Convert::Wikidata::Item::BookEdition, MARC::Convert::Wikidata::Item::Periodical, MARC::Convert::Wikidata::Transform, Scalar::Util.

SEE ALSO

MARC::Record

Perl extension for handling MARC records

Wikibase::Datatype::Item

Wikibase item datatype.

REPOSITORY

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

AUTHOR

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

http://skim.cz

LICENSE AND COPYRIGHT

© 2021-2023 Michal Josef Špaček

BSD 2-Clause License

VERSION

0.01