pkp / ots

PKP XML Parsing Service
GNU General Public License v3.0
32 stars 19 forks source link

Retrieve DOI ID for references delivered by Crossref #134

Closed fabiobatalha closed 6 years ago

fabiobatalha commented 6 years ago

Would be nice to have the DOI number of all the references delivered by Crossref.

<element-citation>
    ...
    <pub-id pub-id-type="doi">10.17226/10732</pub-id>
    ...
</element-citation>
axfelix commented 6 years ago

This should be pretty easy -- it should already be present in the BibTeX we get back from CrossRef in https://github.com/pkp/ots/blob/master/module/ReferencesConversion/src/ReferencesConversion/Model/Converter/References.php, so it's either getting dropped by bib2xml (which might be a pain to fix upstream) or by this XSLT: https://github.com/pkp/ots/blob/master/module/BibtexreferencesConversion/assets/biblatex2xml.xsl

Want to try running some BibTeX from CrossRef through bib2xml to see if it's one or the other?

axfelix commented 6 years ago

OK, looks like an example looks like this (pardon the stupid example, I searched for "cheesecake" and the first result looks like some droll new-atheist type). It does in fact have a DOI:

$ curl --header "Accept: application/x-bibtex" http://dx.doi.org/10.1037/05168212 -L
@article{Robbins_2005,
        doi = {10.1037/05168212},
        url = {https://doi.org/10.1037%2F05168212},
        year = 2005,
        publisher = {Portico},
        volume = {50},
        number = {40},
        author = {Brent Dean Robbins},
        title = {Religion is cheesecake?},
        journal = {{PsycCRITIQUES}}
}
axfelix commented 6 years ago

aaaaaand it looks like the bib2xml output from that string contains this...

<identifier type="doi">10.1037/05168212</identifier>
axfelix commented 6 years ago

https://github.com/pkp/ots/commit/c9f902ac39cb96b9eb8abb7d10c04f643b56cc48 should do it.

fabiobatalha commented 6 years ago

I'm trying to test, but the deposits are failing.

Job Status Creation Date Upload File name Actions
3202 Failed 2018/03/21 06:59:18 d2cce4c7-52a5-409d-ae96-805df2ddbeb3  
3200 Failed 2018/03/21 06:52:55 d2cce4c7-52a5-409d-ae96-805df2ddbeb3
axfelix commented 6 years ago

Sorry about that, forgot I needed to use a simpler XSLT style for this environment

Should be fixed in https://github.com/pkp/ots/commit/7900ecc585d2666d5213f8a06b189bec935c2c2f, will test later today

fabiobatalha commented 6 years ago

It is working, great improvement!!