Issues with CSL json
gbilder opened this issue · 4 comments
(submitted from email sent to labs)
data returned by data.crossref.org (when using Accept: application/vnd.citationstyles.csl+json
) isn't actually csl data json, or at least not the version from this spec. For example, there is no journal-article type, only article-journal. The link in the DOI content negotiation docs seems more or less dead, and the page in the internet archive doesn't cover this field, but the current citeproc-js docs point to CSL and CSL-M. The former is the spec I linked, and the latter is a fork. So, concerning publication type semantics, are you following a different scheme on purpose, and if so, can that scheme be linked to/documented somewhere?
The same goes for some of the fields. The ISSN field shouldn't be an array, and there are probably more, similar issues.
Attached is sample output (curl -LH "Accept: application/vnd.citationstyles.csl+json" https://doi.org/10.1126/science.169.3946.635) demonstrating the things I mentioned in the last two questions.
@gbilder see also the previous issues I've reported on problems with the CSL returned by DOI content negotation:
- #197: Citeproc JSON DOI Content Negotiation produces invalid CSL event
- #187: Invalid types in CSL JSON items returned by DOI content negotiation
For those looking for workarounds, here is the post-processing we performed for the Deep Review on CSL JSON returned by DOI content negotiation.
I was the one to send the email, as I didn't know the docs repo was the place to submit these issues. If I had known, I'd have searched for existing issues on the topic, of course. Anyway, I've also resorted to just modifying the returned CSL for now. I needed some sort of type checking mechanism anyway, so that's not much of a problem. I'll link the code when it's done, for more workaround inspiration.
Regardless of what the docs say, the response retrieved is actually successfully passed through the citeproc JS processor when generating styled citations.
the response retrieved is actually successfully passed through the citeproc JS processor when generating styled citations
@kjw I don't understand and don't think this issue is fixed. The query mentioned by @gbilder:
curl --location --silent \
--header "Accept: application/vnd.citationstyles.csl+json" https://doi.org/10.1126/science.169.3946.635 \
| python -m json.tool
Still returns:
"type": "journal-article",
journal-article
is not a valid CSL type.
Update: @kjw I see you added the bug
label to #187, so presumably you're aware of the CSL type issues and closed this one for a different reason.