Catman...ionship(3pm)

✨ NAME ✨

okay bestie, gather round πŸ’– this is Catman...ionship(3pm) β€” aka Catmandu::FedoraCommons::Model::addRelationship, which is the Perl model for the Fedora addRelationship REST call. that's it, that's the whole vibe. one little model, one big job. πŸ‘‘


🌸 SYNOPSIS 🌸

here's how you actually use it, no cap:

use Catmandu::FedoraCommons;

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

my $obj = $fedora->addRelationship(pid => 'demo:29' , relation => [ 'info:fedora/demo:29' , 'http://my.org/name' , 'Peter'])->parse_content;

see how we spin up the $fedora object first with Catmandu::FedoraCommons->new, then call addRelationship on it? the args go in as a hash β€” pid is 'demo:29', and relation is an arrayref holding 'info:fedora/demo:29', 'http://my.org/name', and 'Peter'. πŸ¦‹

and then .parse_content at the end because we want the actual content back, not just the raw response, yk? πŸ’…

🫢 it returns 1 on success. that's the win condition. that's the slay.

πŸ‘€ SEE ALSO πŸ‘€

  • Catmandu::FedoraCommons β€” the main character this lil model is attached to. go read it, fr fr πŸ“š

and that's the whole page bestie!! πŸŽ€ this was pulled straight from the User Contributed Perl Documentation, running on perl v5.36.0, dated 2023-02-05 β€” so like, bookmark it, screenshot it, put it in the group chat. πŸ’–βœ¨ mwah, go add some relationships, you've got this πŸ¦‹πŸ’…

πŸ“¦ where this page comes from