-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CSL Data: empty date-parts in issued causing pandoc-citeproc to crash #66
Comments
SolutionsThis issue touches on many projects, and there are many possible solutions that should be explored concurrently:
|
This makes sense to me as a temporary workaround. Our short term goal is to be able to upgrade manuscripts to use Manubot v0.2.0. In the longer term, one or more of the other solutions (especially 2-4) would be helpful so that we don't have to treat this as a special case. |
These seem to occur in the wild, and it seems better to parse them as an empty date parts than to crash with a parse error. See manubot/manubot#66.
Currently, the JSON Schema allows empty arrays in date-parts, which can cause downstream citeproc utilities to crash. See manubot/manubot#66 Set minItems to 1 for the date-parts array as well as the nested arrays with year, month, day info.
Currently, the JSON Schema allows empty arrays in date-parts, which can cause downstream citeproc utilities to crash. See manubot/manubot#66 Set minItems to 1 for the date-parts array as well as the nested arrays with year, month, day info.
Merges #65 Fixes empty issued date-parts bug reported in the following issues: - Closes #66 - Closes #75 - Fixes greenelab/meta-review#101 (comment) Recursively remove errors in remove_jsonschema_errors. Combined with a CSL JSON schema that specifies minItems for date-parts, this change fixes the above issues. See citation-style-language/schema#158 for the CSL JSON schema changes that are intended to be present in the CSL schema loaded by this package. Tests removal of empty date-parts for issued object.
Merges #65 Fixes empty issued date-parts bug reported in the following issues: - Closes #66 - Closes #75 - Fixes greenelab/meta-review#101 (comment) Recursively remove errors in remove_jsonschema_errors. Combined with a CSL JSON schema that specifies minItems for date-parts, this change fixes the above issues. See citation-style-language/schema#158 for the CSL JSON schema changes that are intended to be present in the CSL schema loaded by this package. Tests removal of empty date-parts for issued object.
We've addressed this issue for Manubot in #65 / 4e6a0f6. @jgm has updated pandoc-citeproc to not crash when encountering empty date-parts (thanks!) in jgm/pandoc-citeproc@bde816c. I opened a PR to update the CSL JSON schema in citation-style-language/schema#158. So overall things are looking good... hopefully Crossref & authorea will implement solutions 4 & 5, but that is not required for Manubot to work. |
Currently, the JSON Schema allows empty arrays in date-parts, which can cause downstream citeproc utilities to crash. See manubot/manubot#66 Set minItems to 1 for the date-parts array as well as the nested arrays with year, month, day info.
Currently, the JSON Schema allows empty arrays in date-parts, which can cause downstream citeproc utilities to crash. See manubot/manubot#66 Set minItems to 1 for the date-parts array as well as the nested arrays with year, month, day info.
Currently, the JSON Schema allows empty arrays in date-parts, which can cause downstream citeproc utilities to crash. See manubot/manubot#66 Set minItems to 1 for the date-parts array as well as the nested arrays with year, month, day info.
Some Crossref DOI records have their issued date-parts set to null, such as
10.22541/au.149693987.70506124
. In these situations, DOI Content Negotiation for CSL JSON returnsIn the past, before we pruned invalid CSL using the CSL Data JSON Schema, we addressed this case with the following:
https://github.com/greenelab/manubot/blob/693fbb7758b5922add30ecaa6e30acb98426a977/manubot/cite/citeproc.py#L88-L95
Hence, we'd remove
issued
if the first element of the date-parts list in Python wasNone
. In #49, we switched to using the JSON Schema to remove invalid fields and removed custom CSL fixing logic. Our hope was that CSL that passed the JSON Schema would be compliant withpandoc-citeproc
.The JSON Schema currently specifies elements in
date-parts
arrays must be strings or number (excludes null), but does not specifyminItems
of 1. Hence, our CSL Data pruning removes the null item but keeps the empty list:This causes
pandoc-citeproc
to crash (as currently happening withmanubot cite --render doi:10.22541/au.149693987.70506124
and greenelab/meta-review#101 (comment)):This issue was discovered in greenelab/meta-review#101 (comment). The corresponding WIP PR to fix it is #65 (pending a solution).
The text was updated successfully, but these errors were encountered: