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

Hi Shaun

After implement your code. The XML is created. But its return error when depositing to crossref. the result is doi_data expected. Can you explain how to resolve this? thanks

Hi @tanzilmultazam

Can you post an example of your Crossref XML? And are you using the code I posted on June 27? I think the one from April might produce an error like that.

Yes i use your April code. Becuase when i use the code posted on June 27 its return error. Attached is the XML example.

j

The April code will create an error because when you use Crossmark, the license information needs to be inside the crossmark_data tags.

If you have gotten an error using the June code (which is what I am using and is working for me), one possibility is that you are doubling up on the license information. You would need to delete or comment out the license code block that goes like this:

  // license
  if ($publication->getData('licenseUrl')) {
  	$licenseNode = $doc->createElementNS($deployment->getAINamespace(), 'ai:program');
  	$licenseNode->setAttribute('name', 'AccessIndicators');
  	$licenseNode->appendChild($node = >$doc->createElementNS($deployment->getAINamespace(), 'ai:license_ref', htmlspecialchars($publication->getData('licenseUrl'), ENT_COMPAT, 'UTF-8')));
  	$journalArticleNode->appendChild($licenseNode);
  }

This is what I have in my ArticleCrossrefXmlFilter.inc.php (with line numbers):

170 // Crossmark
171 $crossmarkData = $doc->createElementNS($deployment->getNamespace(), ‘crossmark’);
172 $crossmarkPolicy = $doc->createElementNS($deployment->getNamespace(), ‘crossmark_policy’, htmlspecialchars(‘10.xxxxx/crossmark_policy’, ENT_COMPAT, ‘UTF-8’));
173 $crossmarkData->appendChild($crossmarkPolicy);
174 $crossmarkDomains = $doc->createElementNS($deployment->getNamespace(), ‘crossmark_domains’);
175 $crossmarkDomain = $doc->createElementNS($deployment->getNamespace(), ‘crossmark_domain’);
176 $crossmarkDomainEHI = $doc->createElementNS($deployment->getNamespace(), ‘domain’, htmlspecialchars(‘journaldomain.tld’, ENT_COMPAT, ‘UTF-8’));
177 $crossmarkDomain->appendChild($crossmarkDomainEHI);
178 $crossmarkDomains->appendChild($crossmarkDomain);
179 $crossmarkData->appendChild($crossmarkDomains);
180 $crossmarkDomainExclusive = $doc->createElementNS($deployment->getNamespace(), ‘crossmark_domain_exclusive’, htmlspecialchars(‘false’, ENT_COMPAT, ‘UTF-8’));
181 $crossmarkData->appendChild($crossmarkDomainExclusive);
182 $crossmarkCustom = $doc->createElementNS($deployment->getNamespace(), ‘custom_metadata’);
183 // license
184 if ($submission->getLicenseUrl()) {
185 $licenseNode = $doc->createElementNS($deployment->getAINamespace(), ‘ai:program’);
186 $licenseNode->setAttribute(‘name’, ‘AccessIndicators’);
187 $licenseRefNode = $doc->createElementNS($deployment->getAINamespace(), ‘ai:license_ref’, htmlspecialchars($submission->getLicenseUrl(), ENT_COMPAT, ‘UTF-8’));
188 $licenseRefNode->setAttribute(‘applies_to’, ‘vor’);
189 $licenseNode->appendChild($licenseRefNode);
190 $crossmarkCustom->appendChild($licenseNode);
191 }
192 $crossmarkData->appendChild($crossmarkCustom);
193 $journalArticleNode->appendChild($crossmarkData);
194
195
196 // license
197 //if ($submission->getLicenseUrl()) {
198 // $licenseNode = $doc->createElementNS($deployment->getAINamespace(), ‘ai:program’);
199 // $licenseNode->setAttribute(‘name’, ‘AccessIndicators’);
200 // $licenseRefNode = $doc->createElementNS($deployment->getAINamespace(), ‘ai:license_ref’, htmlspecialchars($submission->getLicenseUrl(), ENT_COMPAT, ‘UTF-8’));
201 // $licenseRefNode->setAttribute(‘applies_to’, ‘vor’);
202 // $licenseNode->appendChild($licenseRefNode);
203 // $journalArticleNode->appendChild($licenseNode);
204 //}

Coupled with the modification the funder plugin, I get this XML:

<crossmark>
<crossmark_policy>10.xxxxx/crossmark_policy</crossmark_policy>
<crossmark_domains>
<crossmark_domain>
<domain>journaldomain.tld</domain>
</crossmark_domain>
</crossmark_domains>
<crossmark_domain_exclusive>false</crossmark_domain_exclusive>
<custom_metadata>
<fr:program name="fundref"/>
<ai:program name="AccessIndicators">
<ai:license_ref applies_to="vor">https://creativecommons.org/licenses/by/4.0</ai:license_ref>
</ai:program>
</custom_metadata>
</crossmark>
<doi_data>

Put the code exactly like you did. But the result still “unable to handle the request”. g

My OJS version is 3.1.2.0 and 7.2.24 PHP. is that influence the result?

That looks right to me. The only other thing I can think of is to ask whether you have also made the changes I described in my June post to the funding plugin. If you have done those and it’s still not working, then I don’t know how to solve it.

Yes. its done too. but still “unable to handle this request”. Okay, thanks. I will try to re checking again. Can i know what version your ojs?

Sorry, without being able to see exactly what you have done or what problems it is causing, I can’t help you any more. I’m using OJS 3.1.2-2, so the crossref and funder plugins should be the same.

1 Like

Good morning James,
I’m Carlos Martinez from Spain. It’s been almost two years since you wrote this comment on the forum. I wonder if when the “all in one” Crossref plugin you mentioned is finished, it will incorporate the update of the Crossref schema from version 4.3.6 to 5.3.1. What I am thinking about is the future incorporation of the ROR identifiers of the affiliations, which is an essential aspect for all academic institutions.

Thank you very much
Carlos Martinez

Good morning James,
I’m Carlos Martinez from Spain. It’s almost two years since you wrote this comment on the forum. I wonder if when the “all in one” Crossref plugin you mentioned is finished, it will incorporate the update of the Crossref schema from version 4.3.6 to 5.3.1. What I am thinking about is the future incorporation of the ROR identifiers of the affiliations, which is an essential aspect for all academic institutions.

Thank you very much
Carlos Martinez