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

ciftools is not allowing flexibility in case for attributes #3

Closed
BobHanson opened this issue Nov 29, 2019 · 4 comments
Closed

ciftools is not allowing flexibility in case for attributes #3

BobHanson opened this issue Nov 29, 2019 · 4 comments

Comments

@BobHanson
Copy link
Contributor

BobHanson commented Nov 29, 2019

ciftools-java is requiring exact-case matches to its category and column names. However, http://mmcif.wwpdb.org/docs/tutorials/mechanics/pdbx-mmcif-syntax.html:

Data category and data item names are not case sensitive.

corresponding to

https://www.iucr.org/resources/cif/spec/version1.1/cifsyntax#case

_Case sensitivity

  1. Data names, block and frames codes, and reserved words are case-insensitive. The case of any characters within data values must be respected._

Pull #2 addresses this issue; I thought it would be a separate pull, but I see now that it just attached one push to another. So sorry for that. Included there:

  • the original pull request that covered the lazy initialization of categories (See DemoRead)
  • additional "...Generic" classes that allow bypassing all generated classes and instead using the actual CIF tags for categories and columns (See DemoReadGeneric)
  • code that fixes this capitalization issue -- at least for reading. I didn't implement writing for the generic options and thought perhaps that would be ok anyway, as the point there would be to do the reading specifically generically.
@JonStargaryen
Copy link
Member

Good point, @BobHanson. The implementation indeed diverges from the format specification. However, it provides the same behavior as the original JS impl by David. I'll have a look at it and potentially will disentangle that functionality from #2.

@BobHanson
Copy link
Contributor Author

BobHanson commented Dec 3, 2019 via email

@JonStargaryen
Copy link
Member

JonStargaryen commented Dec 3, 2019

Did some reading. A really elegant solution would be to use new TreeMap<String, Object>(String.CASE_INSENSITIVE_ORDER) which keeps the original case of the keys while making get/put/et al case-insensitive. However, that enforces the natural ordering of all map entries.

Handling of category/column names is case insensitive as of a2f798e. CaseSensitivityTest defines the behavior for reading and writing. Thanks again for the input.

@BobHanson
Copy link
Contributor Author

BobHanson commented Dec 5, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants