MARC::...linCore(3pm)

πŸ“¦
version 0.02 Β· 2 versions
  • 0.02 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 0.02 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– MARC::Crosswalk::DublinCore πŸ’–

okay so bestie, welcome to the User Contributed Perl Documentation section, because this little gem lives there 🫢 it's a Perl module, it's about metadata, and yes it's as iconic as it sounds.


✨ NAME ✨

MARC::Crosswalk::DublinCore β€” literally just here to convert data between MARC and Dublin Core. that's it. that's the whole job. πŸ’…


🌈 SYNOPSIS 🌈

here's the vibe, code and all, no cap:

        my $crosswalk = MARC::Crosswalk::DublinCore->new;

        # Convert a MARC record to Dublin Core (simple)
        my $marc = MARC::Record->new_from_usmarc( $blob );
        my $dc   = $crosswalk->as_dublincore( $marc );

        # Convert simple DC to MARC
        $marc = $crosswalk->as_marc( $dc );

        # Convert MARC to qualified DC instead
        $crosswalk->qualified( 1 );
        $dc = $crosswalk->as_dublincore( $marc );

like, you make the object, you feed it a record, you get a record back. main character energy fr fr πŸ¦‹


🌸 DESCRIPTION 🌸

so this module is an implementation of the LOC's spec on how to convert metadata between MARC and Dublin Core format. (the original page says "implentation" and honestly? we respect the typo, it's canon πŸ’€). the spec for converting MARC to Dublin Core lives at:

http://www.loc.gov/marc/marc2dc.html

and the one for going from DC to MARC is at:

http://www.loc.gov/marc/dccross.html

⚠️ NB, and this is important bestie: the conversion cannot be done in a round-trip manner. i.e. doing a conversion from MARC to DC, then trying to go back to MARC will not yield the original record. it's giving one-way street. the data does not come home. 😭

πŸŽ€ INSTALLATION πŸŽ€

want it installed? two routes, both slay.

to install this module via Module::Build:

        perl Build.PL
        ./Build         # or `perl Build`
        ./Build test    # or `perl Build test`
        ./Build install # or `perl Build install`

to install this module via ExtUtils::MakeMaker:

        perl Makefile.PL
        make
        make test
        make install

πŸ‘‘ METHODS πŸ‘‘

πŸ’œ new( %options )

creates a new crosswalk object. you can pass the "qualified" option (true/false) as well. lowkey the easiest constructor ever.

        # DC Simple
        $crosswalk = MARC::Crosswalk::DublinCore->new;

        # DC Qualified
        $crosswalk = MARC::Crosswalk::DublinCore->new( qualified => 1 );

πŸ’œ qualified( $qualified )

lets you specify if qualified Dublin Core should be used in the input or output. defaults to false (DC simple). so if you don't say anything, it's simple DC, periodt.

        # DC Simple
        $crosswalk->qualified( 0 );

        # DC Qualified
        $crosswalk->qualified( 1 );

πŸ’œ as_dublincore( $marc )

convert a MARC::Record to a DublinCore::Record. this one actually works, we love her ✨

πŸ’œ as_marc( $dublincore )

convert a DublinCore::Record to a MARC::Record.

🚨 NB: not yet implemented. so like, don't hold your breath, bestie πŸ’€

πŸ¦‹ TODO πŸ¦‹

the to-do list, aka the group chat of unfinished business:

  • Implement as_marc()
  • add tests

⭐ SEE ALSO ⭐

go read these, they're iconic:


🌈 AUTHOR 🌈

  • Brian Cassidy <bricas@cpan.org>

Copyright 2005 by Brian Cassidy

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


and that's the whole page, bestie 🫢 this was perl v5.34.0, dated 2022-06-15, filed under that truncated lil MARC::...linCore(3pm) header up top β€” you're welcome, go convert something πŸ’…πŸŒΈ