-
-
Notifications
You must be signed in to change notification settings - Fork 295
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
EDTF dates in BibLaTeX #590
Comments
this one was fairly easy, for that reference I now get
|
Thanks! I'm glad this one was easy. However, I'm not seeing the fix at my end. I get the same faulty results for the same inputs. I suspect either my install is not properly recognizing the updated zotero-better-bibtex plugin or I'm misunderstanding something about updating it. To update I:
Perhaps you could increment the version number at your end (e.g. to 1.6.79)? Or perhaps I'm failing to properly recognize how GitHub works. Specifically perhaps I should read
... as meaning ...
? In which case I have to wait for your next release? |
You will either have to wait for the next release (which I hope will get done in a few days, I'm looking to include #585), or use https://github.com/retorquere/zotero-better-bibtex/releases/download/builds/zotero-better-bibtex-1.6.78-circle-3162.xpi in the interim. |
zotero-better-bibtex-1.6.78-circle-3162.xpi fails to correct the errors. Given you have the hood open for #585 ... take all the time you need and I'll just wait for the next release. There's certainly no urgency from my end. |
Not sure which errors you mean -- given the reference you submitted in
If there are more errors, references that yield these errors would be appreciated. |
I'd actually rather bundle multiple feature requests/bug fixes in a single release rather than releasing a new version for each separately. |
Each of the three errors I mentioned remain. That is, using the entry which you've quoted back to me and trying each of following values, in turn, in Zotero Date:
So, sticking with example you've quoted back to me (Input date 2.), when I use Zotero Given, however, you see the change at your end, and I don't at my end, I'm suspecting:
or
I'm using Zotero 4.0, not Zotero 5.0. Perhaps a third party could be kind enough to tell us what they see at their end (and what OS they are using)?
Yes indeed: that'd be the way to do it. Maybe you'd rather close #585 first (among other issues), and that'll automatically help here. But if there is any test I can perform to help, let me know. |
Ah, yeah, sorry, you need to go into For those three dates (with the setting on) I get
|
#585 just cleared so I'm prepping for release, running tests once more on each of the 3 branches (#585, #587 and #590) slated for this release before I merge them. It'd be good to have confirmation that the output above is what you want, or whether there are still test cases you'd want to have added. |
That's solved, glad it was you not me :) (But I'm guilty of something else as I'll explain below). Yes the three test cases now work at my end. I ensured both of the following where true ...
If you are keen to have a crack at the other EDTF formats then: the EDTF 1.0 (level 0 and level 1) formats that biblatex supports include the following (I've essentially taken a representative sample from biblatex.pdf p37, Database Guide > Usage Notes > Date and Time Specifications):
Other notes:
You'd just need to pass these through without processing. For example, from ...
.... to ...
I notice that, at the moment, you decrement the date to arrive at ...
... which is entirely my fault because of my misleading prior remark ...
... these decrements, and other processing, will get applied by the biblatex system from raw *.bib entry fields, on their way to becoming a pdf. So we want ...
For testing you could just use any entry (barker_2016_turkey would do) and just change the Zotero Date field every time. Edit: Changed last example (~~ ... ~~ represent deletions):
|
|
|
|
Got it -- good spot, that negative-date hack was specific to CSL (#360) but it leaked into the BibTeX export. That date is now |
If |
BTW this is the last issue to close before I cut a release. |
(and email validation is actually not as hard as it's made to look - the rules on domain names are fairly rigid, and you basically should allow everything before the "@". Anything you forbid there is usually wrongly rejected) |
In short, you can close the issue and cut your release.
They are equivalent but you shouldn't allow, or at least not add an option for, "0380 BCE" in BBT for the reasons:
... in addition to whatever other reasons you can point to. The point of my example was for a related but separate purpose: to show that you shouldn't convert "-0379". So, yes, in addition to not converting "-0379" you don't need to allow for "0380 BCE". All your test cases look good (and indeed it's a good idea to include the original three datetime formats). If BBT passes those test cases I think that gets the lion's share of the EDTF formats that biblatex supports. That is, if you are agreeable I'm happy to consider the issue currently closed, and you can go ahead and cut your release, for the sake of "release early and often". That is, at a future point I probably will be able to identify some other test cases for a future release (but if you'd rather have me spend more time on the issue now, I can). On email validation, to the limited extent I grasp the issue, I'm under the impression many webdevs attempt a rigorous validation of addresses, trying to implement the relevant RFC's, and frequently get their implementation wrong: wrongly rejecting valid addresses (as you allude to). Even if I'm mistaken about that I think you get my points for our purpose here: the (strict) validation of EDTF date formats is complex; biblatex undertakes this validation; if you where to attempt that validation it would be a significant task; and, given, the significance of the task there's a liability to get a mismatch between what BBT accepts and what biblatex accepts. The alternative, which I'm under the impression you've implemented, is to have a very permissive validation. So you, correct me if I'm wrong, essentially allow anything through that parses as a (edit: iso) date once you allow for the exceptional characters I've brought to your attention (~,?,/,u etc), with some additional exceptions. That is, your validation is basic rather than strict, to avoiding wrongly rejecting something (edit: and not being too fussed if something illegal under EDTF/Biblatex goes through: biblatex can be left to reject it). If I've broadly understood your approach correctly, then I think that's the right thing for you to do. |
If there's an EDTF pattern I don't yet pick up I'll gladly fix it, but my main worry is not about validating input but about recognizing it and transforming it to something that the Bib(La)TeX processor will understand. I can't be in the validation business because I have no feedback channel. If I establish that your date is b0rked (if it were to say, e.g., And EDTF dates are the easy case, because they're well-structured. I also have to deal with dates like Anyhoo, I've cut the release because it contained some urgent fixes, so we have time for this. If there's patterns I missed, do tell me about them. What does the 1 there actually is a way but the UI would be clunky and everything about the Zotero internals for translators screams "you should most definitely not be doing this" You are right that there are RFCs that cover email addresses, but a) they're more complex than most webdevs are willing to understand, and b) not every smtp server is strict about enforcing those rules and might accept more than the RFCs would permit -- in which case the user would have an out-of-spec but wholly functional email address. Either you pick a well-established library to do such validation (but many seem to think "simple regex, done"), or you need to be liberal about such matters. |
Oh holy crap that |
I'm going to find a lib to parse EDTF as a special case. Too many edge cases. |
Dates are gnarly things and EDTF does well to accommodate the gnarliness, yet be disciplined about it when doing so. Yes finding a library for EDTF parsing could well ease your implementation burden. There's a few at https://www.loc.gov/standards/datetime/implementations.html , notably there's two javascript libraries. I haven't evaluated these.
Add these to the list ...
Looking at the EDTF level 0 and level 1 table of examples and biblatex.pdf I think that exhausts all the types. After I get my hands on your implementation I'll, of course, attempt to break it with edge cases.
Yeah we want to just pass these through, unaltered, to
That helps me see two things.
On this second point is there are a Zotero 5.0 issue (I can't yet install it), or should there be one? That is, does Zotero 5.0 treat date fields differently from Zotero 4.0? Should Zotero 5.0 treat date fields differently by, for example, by allowing users to input any format but having Zotero convert the date into EDTF internally (if so this entail us lobbying the Zotero folks) - something which could ease the burden on the BBT side?
Incidentally why wouldn't you put it in the
... ? |
🤖 this is your friendly neighborhood build bot announcing test build 4628 ("fixes #590 for real (forgot to commit files)"). |
Done
Yes indeed. It sounds like we are in opposing hemispheres, timewise, (I'm at +11:00). If so, that neatly means we are tag teaming it. Those strikethroughs were to make clear where I'd edited my post. Mostly for your benefit in case you read the original, wrong, post before seeing my edits. So, yes, you don't act on the strikethroughs.
On build 4628 that works at my end! To do
|
🤖 this is your friendly neighborhood build bot announcing test build 4634 ("minute-level precision for #590"). |
🤖 this is your friendly neighborhood build bot announcing test build 4637 ("value-qr"). |
Check out the new QR, too. |
All my EDTF dates now pass (against 4637)! Maybe the thing to do is merge 590 into the master, and whatever else you think is outstanding for the "Rewrite for Zotero 5" (including #771?), and I'll retest my EDTF against the master. That is, as a test against a release candidate. That would serve as a final check of my EDTF test dates (noting one's tests are themselves tested). At that point, I'll suggest, I'd post those datetime formats here. |
🤖 this is your friendly neighborhood build bot announcing test build 4657 ("Merge branch 'master' into 590"). |
Here you go. This has everything bundled in. |
(#771 should be done tomorrow somewhere) |
IntroAs expected all my tests against zotero-better-bibtex-5.0.32.4657.issue-590.xpi pass. Therefore you can close this issue. (Repeating earlier information here ...) Biblatex has been supporting the EDTF standard (to "level 1") as hosted at the (US) library of congress (which I'll reference as "EdtfLoc"). Biblatex supports a superset of that standard: a few extra symbols for backward and forward compatibility reasons. Find below an exhaustive excercise of the datetime formats biblatex supports. At least, that is, as the main format variants go. Three of the formats will throw up "WARNS" in biblatex:
In biblatex the minute level precision warning is expected. The double dot ".." warning for open date ranges is a biblatex bug (biblatex.pdf mentions support for this symbol). For BBT purposes those three dateformats are correctly passed through to biblatex. Let me know if you need further info (e.g. Report IDs against the following formats). Legend
CommonTypical
Approximate and Uncertain
Eras
There is nothing special about Precision finer than a yearTimes
Minute level precision - Invalid under EDTF (triggers a ”WARN” underbiblatex)
Dates
RangesCommon
Open
Unknown
Unspecified
Years exceeding four digits
|
Holy shitsnacks I saw that wall of text coming on on mobile and I just panicked there were 10 more edge cases to deal with 😆. Thanks man, merged, two more to go before release. |
Thanks for all that EDTF coding. That really opens up the gates for where I want to go. Incidentally, "wall of text" does not mean "lots of text" ... https://www.urbandictionary.com/define.php?term=wall%20of%20text
... I look forward to the release and hoping that'll afford you a break, or at least allow you to spend far less time on BBT. |
I stand corrected on the wall of text. In my defense, it looked a little packed on my mobile mail preview 😟. A break would be nice, but I'm in the process of putting together a PhD proposal, and that process, as I'll just blindly guess you know, allows for no breaks. incidentally, @blip-bloop should now just ignore closed issues. Stay, @blip-bloop. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
New support for Extended Date/Time Format in Biblatex
Biblatex has recently added support for Extended Date/Time Format 1.0, conforming to levels 0 and 1. In brief, this includes, among other formats:
For all the details, in one's latex install see:
This is available in the production version of biblatex, 3.6. However, there are few bugs there so it might be easier to hold off until 3.7 is released before having a thorough look around.
I note also "PSA: Better BibTeX does not currently support Zotero 5.0 #555" which means you are in a state of flux ... and probably not wanting to write new code until Zotero 5.0 issues stablise.
Also perhaps it will be a rather large effort to verify zotero-better-bibtex properly handles exporting all the EDTF 1.0 date/time formats that biblatex now supports. It might be easier for you if I, and others, flag the relevant export problems one at a time.
That is, even if you want to delay attending to specific zotero-better-bibtex issues, in virtue of doing a major rewrite first, it might be better to feed you these issues one at a time. (Indeed you might prefer to attend to outstanding zotero-better-bibtex issues as you do your major rewrite).
Support times in the Zotero date field.
Consequently, the first problem I'm encountering is ...
Exporting a Zotero entry with a Zotero date in various extended formats (e.g. 2016-07-18T20:26:06+10:00, or 2016-07-18T20:26:06) produces unpredictable results. This is using "Better Biblatex" (not tested in "Better Bibtex").
2016-07-18T20:26:06+10:00
From ...
I get ...
I expect ...
That is, the problem is exporting a date with time and timezone results in the date going to
year
rather thandate
.2016-07-18T20:26:06
From ...
I get ...
I expect ...
That is, the problem is exporting a date with time and no timezone results in the date going to
date
, as expected, but the datetime value has the time portion lost.2016-07-18T20:26:06Z
From ...
I get ...
I expect
That is, the problem is exporting a date with time and "Z" (for Zulu) timezone results in the time portion being lost.
I've sent the full entry to you as ReportID: IRFDJ8NT.
The text was updated successfully, but these errors were encountered: