Catman...lidate(3pm)

🌸 NAME 🌸

okay so Catmandu::FedoraCommons::Model::validate β€” it's a Perl model that wraps up the Fedora validate REST call, bestie. that's the whole vibe πŸ’…

This page is from the User Contributed Perl Documentation (the 3pm girlies, you know the ones) β€” she's Catman...lidate(3pm), no cap.


✨ SYNOPSIS ✨

here's the whole thing in action, literally:

use Catmandu::FedoraCommons;

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

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

{
  'pid'   => 'demo:29' ,
  'valid' => 'false' ,
  'asOfDateTime' => '2013-02-08T10:09:09.273Z' ,
  'model' => [
     'info:fedora/demo:UVA_STD_IMAGE' ,
     'info:fedora/fedora-system:FedoraObject-3.0' ,
  ],
  'problem' => [
     'test'
  ] ,
  'datastream' => [
      {
       'dsID' => 'url' ,
       'problem' => [
          "Datastream 'url' is does not have the FORMAT_URI and MIME_TYPE attributes required by 'demo:UVA_STD_IMAGE'" ,
       ]
      }
  ] ,
}

so you build a Catmandu::FedoraCommons with your URL and creds, you call validate on a pid, you ->parse_content the whole thing, and what you get back is that hashref of dreams up there: pid, valid, asOfDateTime, the model list, the problem list, and a datastream list where every lil' datastream can carry its own dsID and its own problem list. πŸ¦‹


🌈 SEE ALSO 🌈

  • Catmandu::FedoraCommons β€” go read that one too, she's the main character πŸ‘‘

lowkey reminder: every field in that returned hashref is just copied straight from the example β€” don't go inventing new keys and blaming me, bestie 🫢

and that's the whole page, periodt. πŸ’– this was perl v5.36.0, dated 2023-02-05, filed under Catman...lidate(3pm) β€” she ate, no crumbs, mwah πŸŽ€βœ¨

πŸ“¦ where this page comes from