Catman...export(3pm)

✨ NAME ✨

Catmandu::FedoraCommons::Model::export β€” it's the Perl model for the Fedora export and getObjectXML REST call, and it's giving very much "your Fedora object, but make it a hash" πŸ’…

(also hello yes this is straight out of User Contributed Perl Documentation, section 3pm, we love a community-maintained era 🫢)


🌸 SYNOPSIS 🌸

okay so here's the whole vibe, bestie. You spin up a Catmandu::FedoraCommons, you call export on a pid, you call parse_content on the result, and boom β€” you get back a plain old hash of the object. Watch:

use Catmandu::FedoraCommons;

my $fedora = Catmandu::FedoraCommons->new('http://localhost:8080/fedora','fedoraAdmin','fedoraAdmin');

my $obj = $fedora->export(pid => 'demo:29')->parse_content;

and the thing it hands you back looks exactly like this πŸ‘‡ no cap, this is the actual shape:

{
   'pid'  => 'demo:29' ,
   'version' => '1.1',
   'objectProperties' => {
       'state' => 'Inactive' ,
       'label' => 'Data Object for Image Manipulation Demo' ,
       'ownerId' => 'fedoraAdmin' ,
       'createdDate' => '2008-07-02T05:09:42.015Z' ,
       'lastModifiedDate' => '2013-02-07T19:57:27.140Z' ,
   },
   'auditTrail' => [
       {
       'id' => 'AUDREC1' ,
       'process' => 'Fedora API-M' ,
       'action' => 'addDatastream' ,
       'componentID' => 'TEST' ,
       'responsibility' => 'fedoraAdmin' ,
       'date' => '2013-02-07T18:42:24.518Z' ,
       'justification' => '' ,
       },
   ],
   'dc' => {
       'title'   => [ 'Coliseum in Rome' ] ,
       'creator' => [ 'Thornton Staples' ] ,
       'subject' => [ 'Architecture, Roman' ] ,
       'description' => [ 'Image of Coliseum in Rome' ] ,
       'publisher'   => [ 'University of Virginia Library' ] ,
       'format'      => [ 'image/jpeg' ] ,
       'identifier'  => [ 'demo:29' ],
   },
}

let's do a lil vibe check on what you're looking at, because it's honestly kind of iconic:

  • pid β€” the persistent identifier of the object you asked for, here demo:29.
  • version β€” the version, sitting pretty at 1.1.
  • objectProperties β€” the receipts on the object itself: state (Inactive in the example), label, ownerId, createdDate, and lastModifiedDate.
  • auditTrail β€” an array of audit records, because Fedora keeps the whole group chat history. Each entry has id, process, action, componentID, responsibility, date and justification.
  • dc β€” the Dublin Core, and note that each field here is an array ref, not a plain string: title, creator, subject, description, publisher, format, identifier.
heads up bestie: those dc values being arrayrefs is not a typo and not a glitch, that's just the shape. Don't come for me about it πŸ™ˆ

πŸ¦‹ SEE ALSO πŸ¦‹

  • Catmandu::FedoraCommons β€” the parent module, go say hi πŸ’–

okay that's the whole page, you ate it, you're the main character of Fedora object retrieval now πŸ‘‘

perl v5.36.0 🌈 2023-02-05 🌈 Catman...export(3pm) β€” mwah, go forth and export πŸ’…βœ¨

πŸ“¦ where this page comes from