Skip to content
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

How to determine if a date is uncertain? #61

Open
customcommander opened this issue Jan 20, 2019 · 7 comments
Open

How to determine if a date is uncertain? #61

customcommander opened this issue Jan 20, 2019 · 7 comments
Labels

Comments

@customcommander
Copy link
Contributor

The documentation for approximate dates says:

Approximate dates test “true” for the is-uncertain-date conditional (see Choose)

However when looking at the relevant section in Choose, we can see:

Tests whether the given date variables contain approximate dates.

Which links back to where we just came from, so it's unclear how one can determine when a date is uncertain.

Could you explain how uncertain dates are determined please?

@rmzelle
Copy link
Member

rmzelle commented Jan 20, 2019

The CSL specification is currently agnostic about how metadata is fed to the CSL processor, but citeproc-js has established itself as the reference in this regard, upon we based our CSL JSON schema.

https://github.com/citation-style-language/schema/blob/f01ba9c5ec2055e381a38598919a379255c496c5/csl-data.json#L221 shows the "circa" field for date variables in CSL JSON, which indicates whether a date is uncertain. You'd have to check the citeproc-js source code to see what values it uses for this field, as the schema is rather permissive here (presumably a true/false boolean, but I'm not sure).

@rmzelle
Copy link
Member

rmzelle commented Jan 20, 2019

Actually, it looks like citeproc-js uses "circa": 1 (and doesn't supply the field for dates that aren't marked as uncertain). See https://github.com/citation-style-language/test-suite/blob/1b7ce3ceb460dda689f3281c3a5f0617ed6d0805/processor-tests/humans/date_Uncertain.txt#L45

@customcommander
Copy link
Contributor Author

customcommander commented Jan 20, 2019

I see.

So if I understand you correctly, the circa field is only used to flag approximate dates. The JSON schema allows three types of values though: boolean, string and number.

Is it fair to assume that:

  1. A date is uncertain if circa is true
  2. or if circa is set to a string such as 'yes', 'y' or 'true'
  3. or if circa is set to 1
  4. in the absence of a circa field, a date is not considered to be uncertain.

Since csl-data.json is part of the citation-style-language repositories, do you think it would make sense to relate the documentation to it (when appropriate)?

@rmzelle
Copy link
Member

rmzelle commented Jan 20, 2019

Is it fair to assume that:

  1. A date is uncertain if circa is true
  2. or if circa is set to a string such as 'yes', 'y' or 'true'
  3. or if circa is set to 1
  4. in the absence of a circa field, a date is not considered to be uncertain.

Are you generating CSL JSON or writing a CSL processor? I would use 3 for now, but we should make the schema more strict to clarify exactly what values are allowed.

Since csl-data.json is part of the citation-style-language repositories, do you think it would make sense to relate the documentation to it (when appropriate)?

Yes, certainly. We just never came around doing so, but the plan is to move from a descriptive JSON schema (that describes what citeproc-js does) to a prescriptive one (that specifies what CSL processors in general should expect as input data). We're also hoping to add some continuous integration to integrate the schema with the CSL test suite (https://github.com/citation-style-language/test-suite/). At that point we can start referring to it more in the CSL specification.

@rmzelle
Copy link
Member

rmzelle commented Jan 20, 2019

I would use 3 for now,

Make that 3 and 4. Based on the test suite, I'm pretty sure most CSL processors that test against the test suite will be compatible with this use of "circa".

@customcommander
Copy link
Contributor Author

Are you generating CSL JSON or writing a CSL processor?

I'm writing a new JavaScript CSL processor indeed.

es, certainly. We just never came around doing so, but the plan is to move from a descriptive JSON schema (that describes what citeproc-js does) to a prescriptive one (that specifies what CSL processors in general should expect as input data).

That'd be extremely useful!

We're also hoping to add some continuous integration to integrate the schema with the CSL test suite

Do you have some details about it? I may be able to help.

Thanks a lot, that clarified a few things.

@customcommander
Copy link
Contributor Author

we should make the schema more strict to clarify exactly what values are allowed.

I took the liberty to raise this issue just to not forget about it. Hope that's ok.

@bwiernik bwiernik added the 1.1 label Nov 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants