-
-
Notifications
You must be signed in to change notification settings - Fork 288
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
Season ranges should be exported as pseudo-months (13-16, or 21-24) #860
Comments
wait -- CSL YAML and CSL JSON differ structurally? I thought they were the same except the delivery format. |
Can you get me a source reference by way of a BBT error report? |
🤖 this is your friendly neighborhood build bot announcing test build 5224 ("season ranges"). |
So what would the CSL representation of "Summer 2017 - May 2018" be? Is there documentation of the allowed formats? CSL YAML supports both the year-season and the date-parts structure, no? I'd rather keep it all the same if possible. |
Sample: Report ID HD5D2RMI
I’m afraid so. For clarity, the CSL YAML we’re dealing with should probably better referred to as “pandoc CSL YAML” – the in-field markup is different, and so are the date formats. pandoc-citeproc seems to be able to parse most dates in the citeproc-js CSL JSON format when delivered as YAML, but has also introduced, I suppose for better readability, its own date format with For me personally, pandoc CSL YAML season ranges are of secondary importance (after all, pandoc-citeproc can be used to convert CSL JSON to pandoc CSL YAML), so you might as well choose not to implement this straight away – and hope for a speedy introduction of EDTF dates for CSL JSON and YAML, which would of course make this whole exercise unnecessary. |
I knew about the in-field markup, but it was my understanding that CSL-YAML supported both date formats -- both the more readable format, and the admittedly less-than-great CSL-JSON format. If that is true this simplifies the exporters because I can (and currently do) use common infrastructure for both. Just so I have things clear for the CSL-JSON case:
Would the general rule just be "season point-dates get a season field, ranges (even if they have a season) always get only date-parts with a pseudo-month?' |
BBT uses the numeric format for seasons as per https://github.com/citation-style-language/schema/blob/master/csl-data.json#L214 |
Should |
So I'm going for 13 to 16 rather than 21 to 24 for wider compatibility. |
(NM on |
All yes. (It never occurred to me that someone might want to mix months and seasons in a date range, but there seems to be nothing in the 2016 ISO 8601 working draft that would forbid this, and it appears to work as expected with pandoc-citeproc, at least when using chicago-author-date.csl.) To be clear about generic vs. pandoc CSL YAML: the only kind of date pandoc-citeproc cannot parse from generic CSL YAML is a season range with seasons represented as pseudo-months. If you feel you’d rather want to stick to generic CSL YAML (generic wrt dates) for BBT, we could also try to get pandoc-citeproc fixed to accept pseudo-months here. |
No, if pandoc-csl-yaml expects season ranges as season fields, that can be done. AFAICT, pandoc is the only consumer of csl-yaml, might as well cater to its needs. |
🤖 this is your friendly neighborhood build bot announcing test build 5228 ("test case for #860"). |
Just to be clear: the csl-yaml should look like this, correct?
|
Correct. |
ugh, this touches csl-yaml date handling more generally. What are the accepted date denotations for csl-yaml? |
The output from
… so it’s more ISO8601/EDTF-like, with separate season and circa elements for start and end dates. |
Then perhaps it isn't according to the WD 2016-02-16 that EDTF.js implements ¯\_(ツ)_/¯. If I put that in EDTF.js it complains about the slash. |
Well, no. From https://www.loc.gov/standards/datetime/ISO_DIS%208601-2.pdf (ISO/DIS 8601-2:2016(e), 2016-10-26; this passage unchanged from the 2016-02-16 version except for section numbering): “4.7 Divisions of a year So seasons should be treated just like months. Looks like an EDTF.js bug to me. |
gives
|
EDTF.js has no issue with the individual dates though. It has a problem with the range. |
I’d maintain that since year-month ranges are valid EDTF, so are year-season ranges. |
I'm not contesting that -- I'm just reporting what I see happening when EDTF.js is passed these dates. I can't find the part of the spec that talks about date ranges at all, so I don't know what the spec says about this. |
I think it’s mainly in https://www.loc.gov/standards/datetime/ISO_DIS%208601-2.pdf: 4.4.4.1 Representations of time intervals identified by start and end, and 4.4.5 Representations other than complete. I’d agree it’s not easy to find, but I think it’s uncontroversial that YYYY-MM/YYYY-MM is valid, and if it is, then YYYY-SS/YYYY-SS must be valid, too. Out of curiosity: does EDTF.js accept season ranges when using EDTF level 2? |
I don't think so because without further config, EDTF.js defaults to the highest supported spec (IIRC). |
Test build 5241 seems to export ISO 8601/EDTF season ranges to CSL alright – so it would seem you’re bypassing EDTF.js here, right? Would you feel it’s still worthwhile to file a bug report with EDTF.js? If so, would you be willing to do that – you might be able to explain more clearly how exactly BBT is using EDTF.js? One more glitch, too: year 0 (ISO) is year -1 (CSL), year -1 (ISO) is year -2 (CSL), and so on. (CSL uses, quite awkwardly, 5241 exports |
Yep, BBT does a few heuristic stabs before and after it tries EDTF parsing; before are those patterns that confuse EDTF.js, after are those for when both the early heuristics and EDTF.js fail; the season ranges get caught by the
Check: inukshuk/edtf.js#12
Right, I think I've found the cause of that. |
🤖 this is your friendly neighborhood build bot announcing test build 5252 ("year zero"). |
5252 fixes the seasons-BCE problem but also a bug with year zero in biblatex. |
🤖 this is your friendly neighborhood build bot announcing test build 5253 ("dateparser"). |
Great. I haven’t been able to spot any further problems so far. |
This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread. |
The CSL specs allow just one season element per date, so season ranges cannot be expressed in (specs-compliant) CSL JSON. The workaround used by citeproc-js, and adopted as of recently by pandoc-citeproc, is to use pseudo-months instead. citeproc-js has been using
13
to16
; pandoc-citeproc accepts these, and in addition the more ISO8601/EDTF-like21
to24
.It would be great if BBT could export season ranges entered in Zotero date fields, such as
Summer 2015 - Winter 2016
, or2015-22/2016-24
to CSL JSON as either, e.g.,or
… whichever version you prefer.
Of course this should be used for season ranges only – for point dates containing a season, BBT should continue using the
season
element.The correct way to export season ranges to biblatex is to use its native ISO8601/EDTF format, e.g.:
For pandoc’s CSL YAML format, the expected output is:
The text was updated successfully, but these errors were encountered: