Hyperlinks for the DOIs

Hello community
To fulfill our CrossRef membership agreement terms, I would like to create hyperlinks for the DOIs in the references of our OJS journals (reference linking). We’ve used the Simple Text Query Tool from CrossRef to find the DOIs for the references. When using the metadata editor to copy and paste the references in our back files, the DOIs become plain text. I know hyperlinks can be done manually one at a time by adding HREF tags, but it is time consuming. Is there an effective way to create hyperlinks of DOIs for older articles?
Thanks

1 Like

Hi @madeleine,

Unfortunately I’m afraid href tags are currently the way to do it. I’m hoping we give this some further attention in future releases of OJS – and in particular you might be interested in our XML project, which facilitates automatic transformation of source documents into publication-ready XML, PDF, and HTML; @axfelix can give you some more information on that.

Regards,
Alec Smecher
Public Knowledge Project Team

Is there any update to this for OJS 3?

Hi all,

@madeleine, what OJS version are you using? In the new OJS version 3.1.0-1, there is a possibility to automatically parse the citation text entered in the textarea. That way each citation will be parsed ans saved as such. Then when displayed the links in those parsed citations will be displayed as such i.e. using the <a href. Thus if your DOI are as links i.e. something like https://doi.org/10.12345/tj1.v1i2.3, they will be displayed as links.

We are also working on the reference linking plugin, that will use a new Crossref API that is still in development, to automatically get the DOIs for those parsed citations. Those DOIs will then be saved in the DB, together with the parsec citations, and then also automatically added/linked at the end of the citation when displaying them on the article page… But this is still work in progress – just an info that it will come one day… :slight_smile:

Best,
Bozana

Hi Bozana,
We are using OJS 3.1. Even though we have entered references in the citation text area, no hyperlinks appear as links. I believe you are referring to the References section under the Submission and Publication Metadata of the article. Is there anything else we have to do to make them appear as links?

Ah, sorry @pcansf, then it will be in the coming 3.1.1 release – It was merged with this issue. citations parsing by line · Issue #3028 · pkp/pkp-lib · GitHub, but I see now that it was merged with the master branch, that was not used for the 3.1.0-1 release… Sorry :frowning: But, coming… :slight_smile:

EDIT: Yes, I mean “References” in the submisison metadata, that will then be moved to the separate tab and then there they will also have to be parsed – there will be a button to do that.
For the older citations, there will be a script to parse them: https://github.com/pkp/pkp-lib/blob/master/tools/parseCitations.php.
Requirement is however, that the citations/references are entered properly line by line i.e. each citation/reference in a new line.

Thank you again. Do the citations have to be in a certain format? We will be eagerly waiting for the 3.1.1 release.

Hi @pcansf

No, the citations do not have to be in a certain format. Note that there is no semantic citation parsing this way (i.e. this way we are not parsing author, title, etc.), but just single citation (as text) extraction (so that each and unstructured citation can be send to Crossref later) + that we try to display the hyperlinks…

Best,
Bozana

Hi @bozana

I’ve just successfully upgraded to OJS 3.1.1-4 and entred some new publications. Upon editing the references in the resp. modal in the metadata tab I could see that there was some parsing going on with some endless wheelspin. Nevertheless the references where stored and being displayed.
As for the parsing part I was wondering whether this is already active in OJS 3.1.1-4, also the script for older citations (as you mentioned).
I would just like to have URLs in references being active links / hrefs.
Can I somehow monitor for the success of the parsing?

Hi @klausru

Yes, that parsing is active in OJS 3.1.1-4, but there seem to be a but in saving the metadata modal, s. Submission and Publication Metadata parse Error · Issue #4144 · pkp/pkp-lib · GitHub i.e. Submission metadata form: pressing save button triggers browser errors · Issue #4072 · pkp/pkp-lib · GitHub.

To parse the older citations, you can use the following command from your OJS folder:
php lib/pkp/tools/parseCitations.php
Using the appropriate parameter, you can parse all citations, the citations for one journal (context) or for a submission.

Best,
Bozana

Great, thanks for clarifying.
Just this one to be sure: Does the parser extract URLs and wrap them with <a href="...> , or is it at least suppost to do that? In my case it doesn’t, and I was aleady about to do that with some jquery autolink.

Best Klaus

Ok. I found that function in pkp-lib/classes/citation/ Citation.inc.php line 50ff.
Now, I need to find out why my URLs are not being stored with <a href="...>

It took a couple of hours to find out, why URLs have not been wrapped with <a href="...>
The key was this post: Links and strip_unsafe_html - #2 by ctgraham and realising that I copied my config.inc.php from OJS Version 2.4. The pattern in allowed_html = ... meanwhile changed. So it is advised to upgrade this line, too.
Now I just have to find out why my addition of target="_blank" to pkp-lib/classes/citation/ Citation.inc.php does not work, yet.
But I am making progress.