Catman...ommons(3pm)

πŸ’– Catmandu::Store::FedoraCommons πŸ’–

okay bestie, so this is a User Contributed Perl Documentation page β€” the manual for Catmandu::Store::FedoraCommons(3pm) β€” and I am so excited to walk you through it. it's giving ✨archival storage but make it fashion✨. let's go πŸ¦‹


🌸 NAME 🌸

Catmandu::Store::FedoraCommons β€” a Catmandu::Store plugin for the Fedora Commons repository πŸŽ€


✨ SYNOPSIS ✨

here's the whole vibe, verbatim, no cap:

use Catmandu::Store::FedoraCommons;

my $store = Catmandu::Store::FedoraCommons->new(
        baseurl  => 'http://localhost:8080/fedora',
        username => 'fedoraAdmin',
        password => 'fedoraAdmin',
        model    => 'Catmandu::Store::FedoraCommons::DC' # default
);

# We use the DC model, lets store some DC
my $obj1 = $store->bag->add({
                   title => ['The Master and Margarita'] ,
                   creator => ['Bulgakov, Mikhail'] }
           );

printf "obj1 stored as %s\n" , $obj1->{_id};

# Force an id in the store
my $obj2 = $store->bag->add({ _id => 'demo:120812' , title => ['The Master and Margarita']  });

my $obj3 = $store->bag->get('demo:120812');

$store->bag->delete('demo:120812');

$store->bag->delete_all;

# All bags are iterators
$store->bag->each(sub {
    my $obj = $_[0];
    my $pid = $obj->{_id};
    my $ds  = $store->fedora->listDatastreams(pid => $pid)->parse_content;
});

$store->bag->take(10)->each(sub { ... });

like… look at that. storing Mikhail Bulgakov's The Master and Margarita in a Fedora repo. iconic behavior honestly πŸ‘‘


πŸ’… DESCRIPTION πŸ’…

Catmandu::Store::FedoraCommons is a Perl package that can store data into FedoraCommons backed databases. the database as a whole is called a 'store'. databases also have compartments (e.g. tables) called Catmandu::Bag-s πŸ‘œ. in Fedora we have namespaces. a bag corresponds to a namespace. the default bag corresponds to the default namespace in Fedora. iykyk.

by default Catmandu::Store::FedoraCommons works with a Dublin Core data model. you can use the add, get and delete methods of the store to retrieve and insert Perl HASH-es that mimic Dublin Core records. optionally other models can be provided by creating a model package that implements a 'get' and 'update' method. slay 🌈


🫢 METHODS 🫢

πŸ’– new(baseurl => $fedora_baseurl , username => $username , password => $password , model => $model )

create a new Catmandu::Store::FedoraCommons store at $fedora_baseurl. optionally provide a name of a $model to serialize your Perl hashes into a Fedora Commons model. yes bestie, you get to pick the model πŸ’…

πŸŽ€ bag('$namespace')

create or retrieve a bag. returns a Catmandu::Bag. use this for storing or retrieving records from a fedora namespace. it's literally the doorway to your records πŸšͺ✨

🌸 fedora

returns a low level Catmandu::FedoraCommons reference. it's giving… backstage pass 🎟️


πŸ‘‘ INHERITED METHODS πŸ‘‘

this Catmandu::Store implements:

  • Catmandu::Store

each Catmandu::Bag in this Catmandu::Store implements:

  • Catmandu::Bag

periodt. no notes πŸ’…


🌈 SEE ALSO 🌈

  • Catmandu::FedoraCommons

⭐ AUTHOR ⭐

  • Patrick Hochstenbach, "<patrick.hochstenbach at ugent.be>" β€” thank you for your service king πŸ«‘πŸ’œ

okay that's the whole page bestie, you ate that πŸ“

this manual page shipped with perl v5.36.0 and is dated 2023-02-05, under the manual name Catman...ommons(3pm). mwah, bye πŸ’‹πŸŽ€
πŸ“¦ where this page comes from