CrossMark support

Hello,

is the CrossMark service going to be supported in the future releases of the OJS?

Best,

Peter

1 Like

Hi @piotreba ,

It’s come up a few times on the forums before, but at the moment it’s not a high priority for us.

Regards,
Alec Smecher
Public Knowledge Project Team

How can I add CrossMark link to the articles

Hi all,

Crossmark support is something we’re looking into. Right now we’re fine-tuning the Crossref deposit plugin as it currently exists, making it work better and provide more comprehensive and comprehensible results. Once that is done, we’ll be adding other features in coordination with Crossref, including Crossmark support. These new features will be completed on the 3.x line, not the 2.x line. No firm guesses as to when they will be done, but maybe a 6 month window from now.

Cheers,
James

Now that Crossmark is free, is Crossmark support more likely to come to OJS?

I don’t know enough PHP to add settings for Crossmark to the relevant plugins to allow users to switch Crossmark on or off and provide their Crossmark policy DOI, but I have been able to implement it in OJS by customising the code a little. I’ve detailed my changes below in case anyone finds it helpful or wants to use it for their own journal.

In case it helps anyone who wants to use Crossmark, for my own journal, I added the following code to ArticleCrossrefXmlFilter.inc.php after where it exports license details, around line 178. I am not sure if this is the right spot for it, but it can be moved around if it doesn’t work:

// Crossmark
$crossmarkData = $doc->createElementNS($deployment->getNamespace(), 'crossmark_data');
$crossmarkPolicy = $doc->createElementNS($deployment->getNamespace(), 'crossmark_policy', htmlspecialchars('10.xxxx/crossmark_policy_doi', ENT_COMPAT, 'UTF-8'));
$crossmarkData->appendChild($crossmarkPolicy);
$crossmarkDomains = $doc->createElementNS($deployment->getNamespace(), 'crossmark_domains');
$crossmarkDomain = $doc->createElementNS($deployment->getNamespace(), 'crossmark_domain');
$crossmarkDomainWeb = $doc->createElementNS($deployment->getNamespace(), 'domain', htmlspecialchars('journaldomain.tld', ENT_COMPAT, 'UTF-8'));
$crossmarkDomain->appendChild($crossmarkDomainWeb);
$crossmarkDomains->appendChild($crossmarkDomain);
$crossmarkData->appendChild($crossmarkDomains);
$crossmarkDomainExclusive = $doc->createElementNS($deployment->getNamespace(), 'crossmark_domain_exclusive', htmlspecialchars('false', ENT_COMPAT, 'UTF-8'));
crossmarkData->appendChild($crossmarkDomainExclusive);
$journalArticleNode->appendChild($crossmarkData);

I also changed line 175 of ArticleCrossrefXmlFilter.inc.php to add the attribute applies_to="vor". This means that when people click on the Crossmark button, the license information will show as applying to the Version of Record rather than unspecified.

$licenseRefNode = $doc->createElementNS($deployment->getAINamespace(), 'ai:license_ref', htmlspecialchars($submission->getLicenseUrl(), ENT_COMPAT, 'UTF-8'));
$licenseRefNode->setAttribute('applies_to', 'vor');

This results in adding the following XML to the Crossref exports, which covers minimum for a Crossmark deposit.

<crossmark_data>
<crossmark_policy>10.xxxx/crossmark_policy_doi</crossmark_policy>
<crossmark_domains>
<crossmark_domain>
<domain>journaldomain.tld</domain>
</crossmark_domain>
</crossmark_domains>
<crossmark_domain_exclusive>false</crossmark_domain_exclusive>
</crossmark_data>

Then, for the crossmark widget, I found the relevant part of my theme and inserted the crossmark widget code. For Health Sciences, it is around line 253 of article_details.tpl. The other metadata plugins already inserted the DOI in the HTML header, so the button works.

Hi Shaun,

Thanks for inquiring, and also for providing the solution you’ve established! The code looks good to me on first pass. I just had a meeting today with Crossref, and we talked about formal Crossmark inclusion along with some other code updates. We don’t have a firm timeline in place just yet, but our next round of Crossref-related development work will address the following:

  1. UI/UX updates to simplify DOI management, including better batch article/issue management tools.
  2. Consolidating the Funding Data and Reference Linking plugins into the one single Crossref plugin.
  3. Implementing Cited By support.
  4. Implementing Crossmark support.

We’ll be tackling things in roughly that order. I don’t think there is any plan for Crossmark support that will interfere with how you have done things already - ie. once Crossmark support is available in OJS 3.x formally, all you should have to do is remove your customizations and enable the Crossmark option in the Crossref plugin. We are also planning on looking at auto-embedding the Crossmark code in PDFs as well as HTML files, though that’s a bit more technically challenging and may require a specific server setup. But for sure, the basics should be there before too long.

Cheers,
James

1 Like

Hi James

I like the idea of integrating the funding and references plugins with the main crossref plugin.

It also makes a difference for Crossmark support. According to the schema, fundref and access indicators go under the custom_metadata tag in the Crossmark tag, while for non-Crossmark DOIs they can sit independently.

So I changed the code block I had previously (also changing <crossmark_data> to <crossmark>) so that it incorporates the license information:

// Crossmark
$crossmarkData = $doc->createElementNS($deployment->getNamespace(), 'crossmark_data');
$crossmarkPolicy = $doc->createElementNS($deployment->getNamespace(), 'crossmark_policy', htmlspecialchars('10.xxxx/crossmark_policy_doi', ENT_COMPAT, 'UTF-8'));
$crossmarkData->appendChild($crossmarkPolicy);
$crossmarkDomains = $doc->createElementNS($deployment->getNamespace(), 'crossmark_domains');
$crossmarkDomain = $doc->createElementNS($deployment->getNamespace(), 'crossmark_domain');
$crossmarkDomainWeb = $doc->createElementNS($deployment->getNamespace(), 'domain', htmlspecialchars('journaldomain.tld', ENT_COMPAT, 'UTF-8'));
$crossmarkDomain->appendChild($crossmarkDomainWeb);
$crossmarkDomains->appendChild($crossmarkDomain);
$crossmarkData->appendChild($crossmarkDomains);
$crossmarkDomainExclusive = $doc->createElementNS($deployment->getNamespace(), 'crossmark_domain_exclusive', htmlspecialchars('false', ENT_COMPAT, 'UTF-8'));
crossmarkData->appendChild($crossmarkDomainExclusive);
$crossmarkCustom = $doc->createElementNS($deployment->getNamespace(),'custom_metadata');
// license
if ($submission->getLicenseUrl()) {
$licenseNode = $doc->createElementNS($deployment->getAINamespace(), 'ai:program');
$licenseNode->setAttribute('name', 'AccessIndicators');
$licenseRefNode = $doc->createElementNS($deployment->getAINamespace(), 'ai:license_ref', htmlspecialchars($submission->getLicenseUrl(), ENT_COMPAT, 'UTF-8'));
$licenseRefNode->setAttribute('applies_to', 'vor');
$licenseNode->appendChild($licenseRefNode);
$crossmarkCustom->appendChild($licenseNode);
}
$crossmarkData->appendChild($crossmarkCustom);
$journalArticleNode->appendChild($crossmarkData);

But this then creates an incompatibility with the funding plugin. To fix this, after line 198 in FundingPlugin.inc.php, I needed the funding plugin to check that if there was a custom_metadata element:

$customNode = $articleNode->getElementsByTagName('custom_metadata')->item(0);

And then later when it is deciding where to insert the funding data on lines 226-30, replace:

if ($aiProgramDataNode) {
$articleNode->insertBefore($programNode, $aiProgramDataNode);

with code that inserts it into the custom_metadata element instead of into the journal_article element:

if ($customNode) {
$customNode->insertBefore($programNode, $aiProgramDataNode);
} elseif ($aiProgramDataNode) {
$articleNode->insertBefore($programNode, $aiProgramDataNode);

I have checked the output using the Crossref Metadata Parser and it seems to be OK. Hopefully this will be helpful to other people out there who are interested in implementing Crossmark.

Hi Shaun,

Thanks for this!! This is all great info. I’ll pass it on to the developer who’s been tasked with working on this stuff. Also CC’ing @ajnyga, who develops the Funding Data plugin and may be interested in taking a look at what you’ve provided. If there’s a way we can integrate this sooner rather than later, I’d be game.

Cheers,
James

1 Like