Displaying additional DC elements in the OAI Feed

I am in the process of trying to add a standardized rights statement to our elements in Omeka Classic, with the intention of making it available in our OAI feed. We are using the OAI-PMH Repository plugin.

In the elements table, I created the new element. It will display on the Omeka site fine. However, when I pull our OAI feed it is missing.

Somewhat related, I was able to create an extra line in our OAI feed for the item cover thumbnail by adding the following code in …/OaiPmhRepository/Metadata/OaiDc.php.

            if(get_option('oaipmh_repository_expose_files')) 
               {
                   $files = $item->getFiles();
                   foreach($files as $file) 
                   {
                      if ($file->mime_type == 'image/jpeg') 
                      {
                      $oai_dc->appendNewElement('dc:identifier', $file->getWebPath('thumbnail'));
                      break;
                      }
                    }
               }

I assume that I could somehow do the same with the standardized rights statement that we added, but I don’t know how to reference it in the OaiDc.php file. It looks like it is pulling the Dublin Core elements from another source.

Any help or hints would be greatly appreciated.

Cheers.
CM

It really depends how you’re doing the rights statement, but in the metadata formats for the OAI repository, you have access to the $item object, which should be sufficient to get that however you’ve got it stored. If it’s just an element, then that should be no problem. There’s really no “magic” in how that class is getting the elements, there’s just a list of the Dublin Core elements there.

I tried to include the manually added element and it still isn’t displaying. Perhaps if I give more information, it will help.

We are trying to include a Standardized Rights Statement element, in addition to the Rights element that is included by default. We created the Standardized Rights Statement element in the elements table in MySQL. We can enter data into that field and it displays on the Omeka site. However, we would like it also to display in our OAI feed as an additional rights statement, viz., "<dc:rights>http://rightsstatements.org/vocab/NoC-US/1.0/</dc:rights>".

I assume I have to somehow pull the manually added element into the array included in OaiDc.php file.

I hope this sheds more light on what we’re trying to accomplish. I appreciate your help.

Thanks in advance.
CM

A simple solution I found, assuming the DPLA hub can harvest from the qualified Dublin Core feed, is to add 'Standardized Rights Statement' => 'dc:rights'
at the end of the $dcExtendedElements array in OaiQdc.php.

I was really hoping to include the rights statement within the simple dublin core feed. If anyone has any pointers on that, I’d appreciate it; however, for now this solution may work.

Cheers.
CM

There’s really no special difference between what the two do here. If you look at both, you’ll see that they both just use $item->getElementTexts to get the metadata and appendNewElement to add to the output.

The OaiDc format already has basically an example of what you want to do in the if($elementName == 'identifier') block, which you’ve already seemingly extended/altered. If anything, adding the output of your new element is simpler even than that.