Chemical-Curation / chemcurator_django

Backend services for chemical curation
https://api.chemreg.epa.gov
MIT License
1 stars 0 forks source link

name/synonym restrictive validation bug on creating non-restrictive synonym #263

Closed cmgrulke closed 3 years ago

cmgrulke commented 3 years ago

Describe the bug Validation as specified in issue #145 is not working as expected when attempting to create a synonym associated with a non-restrictive synonymQuality

To Reproduce Steps to reproduce the behavior:

  1. Create a synonym that is linked to a restrictive synonym quality
  2. Attempt to create another synonym with the same identifier that is linked to a non-restrictive synonym quality
  3. See the error stating the synonym.identifier value already exists (but it shouldn't matter because this new synonym is non-restrictive)

Expected behavior If I create the synonym "water" and associated it with a restrictive synonym quality, I should still be able to create the synonym "water" as a synonym associated with a non-restrictive synonym.

Additional Context This use case is actually more common than you would expect due to the mess of chemical name usage by scientists. "Sorbic Acid" has been used to mean (2E,4E)-hexa-2,4-dienoate or just hexa-2,4-dienoate without defined double bond stereochemistry. Curators have determined that "Sorbic Acid" is a valid synonym (restrictive) for hexa-2,4-dienoate and an ambiguous synonym for (2E,4E)-hexa-2,4-dienoate. We want both to be hits from resolution, but for the hexa-2,4-dienoate to be a higher scored hit.