OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



field 001 OAI output +OAIMetadataFormat_MARC21.inc changes

OJS development discussion, enhancement requests, third-party patches and plug-ins.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
The Public Knowledge Project Support Forum is moving to http://forum.pkp.sfu.ca

This forum will be maintained permanently as an archived historical resource, but all new questions should be added to the new forum. Questions will no longer be monitored on this old forum after March 30, 2015.

field 001 OAI output +OAIMetadataFormat_MARC21.inc changes

Postby libsupport » Thu Apr 07, 2011 2:02 am

Greetings,

I was trying to import records that where exported from OJS via OAI/marcxml to another system, and realized that (contrary to oai_dc that worked perfectly), with metadataPrefix=marcxml there is NO identifier for each record inside the marc data.
Although I'm not familiar with the internals of OJS nor with the implementation decisions, I found out that I could get the desired result by adding the following line to OAIMetadataFormat_MARC21.inc.php:
83a84
> "\t<controlfield tag=\"001\">" . $article->getBestArticleId() . "</controlfield>\n" .
I believe that this controlfield is crucial for a marc record and should be present if/whenever possible (in addition to the existing OAI Identifier).

In addition to 001, it seems that MARC fields need reordering (so that they follow an ascending order), and I think field 260b is used in a wrong way.
Since the MARC record that is returned from OAI is for the article, the Journal Title, Volume, Date, etc need to be put in the 773 field (Host Item Entry). I propose using at least the following MARC subfields:
773t: Journal Title
773g: Volume/Issue etc
773x: ISSN
773d: Publisher/date of publication

My proposal for the record constructing code is in plugins/oaiMetadataFormats/marcxml/OAIMetadataFormat_MARC21.inc.php:
Code: Select all
$response = "<record\n" .
"\txmlns=\"http://www.loc.gov/MARC21/slim\"\n" .
"\txmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" .
"\txsi:schemaLocation=\"http://www.loc.gov/MARC21/slim\n" .
"\thttp://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd\">\n" .
"\t<leader>     cam         3u     </leader>\n" .
"\t<controlfield tag=\"001\">" . $article->getBestArticleId() . "</controlfield>\n" .
"\t<controlfield tag=\"008\">\"" . date('ymd Y', strtotime($issue->getDatePublished())) . "                        eng  \"</controlfield>\n" .
$this->formatElement('042', ' ', ' ', 'a', 'dc');
foreach ($journal->getTitle(null) as $locale => $title) {
        if ($locale == $journal->getPrimaryLocale()) continue;
                $response .= $this->formatElement('242', '0', '0', 'a', $article->getTitle($locale));
                //$response .= $this->formatElement('242', '0', '0', 'y', $locale);
        }
$response .= $this->formatElement('245', '0', '0', 'a', $article->getTitle($journal->getPrimaryLocale())) .
$this->formatElement('260', ' ', ' ', 'c', $issue->getDatePublished()) .
$this->formatElement('500', ' ', ' ', 'a', $coverage) .
$this->formatElement('520', ' ', ' ', 'a', $article->getLocalizedAbstract()) .
$this->formatElement('540', ' ', ' ', 'a', strip_tags($journal->getLocalizedSetting('copyrightNotice'))) .
$this->formatElement('546', ' ', ' ', 'a', $article->getLanguage()) .
$this->formatElement('653', ' ', ' ', 'a', $subject) .
$this->formatElement('655', ' ', '7', 'a', $section->getLocalizedIdentifyType()) .
$this->formatElement('720', ' ', ' ', 'a', $creators) .
$this->formatElement('720', ' ', ' ', 'a', strip_tags($article->getLocalizedSponsor())) .
$this->formatElement('773', ' ', ' ', 'd', $publisher) .
$this->formatElement('773', ' ', ' ', 'g', $issue->getIssueIdentification().", ".$pages) .
$this->formatElement('773', ' ', ' ', 't', $journal->getTitle($journal->getPrimaryLocale())) .
$this->formatElement('773', ' ', ' ', 'x', $issn) .
$this->formatElement('786', '0', ' ', 'n', $source) .
$this->formatElement('787', '0', ' ', 'n', $record->relation) .
$this->formatElement('856', ' ', ' ', 'q', $format) .
$this->formatElement('856', '4', '0', 'u', Request::url($journal->getPath(), 'article', 'view', array($article->getBestArticleId()))) .
"</record>\n";


where $issn is defined some lines before as: if ($onlineIssn !="" and $onlineIssn!=$printIssn) $issn=$onlineIssn; else $issn=$printIssn;

What do you think?

Best regards,
Theodoropoulos Theodoros
Last edited by libsupport on Mon Apr 11, 2011 5:28 am, edited 1 time in total.
libsupport
 
Posts: 7
Joined: Fri Jan 07, 2011 3:44 am

Re: field 001 OAI output +OAIMetadataFormat_MARC21.inc changes

Postby jmacgreg » Tue Apr 12, 2011 3:03 pm

Hi Theodoropoulos,

Thanks for the report! We have vetted your suggestions, and they look great to us. I've posted this as a bug report here: http://pkp.sfu.ca/bugzilla/show_bug.cgi?id=6585. Please feel free to CC yourself to that report for future updates.

Cheers,
James
jmacgreg
 
Posts: 4191
Joined: Tue Feb 14, 2006 10:50 am


Return to OJS Development

Who is online

Users browsing this forum: No registered users and 2 guests