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

Zooma gives an error when the annotation that is searched for contains brackets. #36

Open
henrietteharmse opened this issue Oct 16, 2019 · 3 comments

Comments

@henrietteharmse
Copy link
Contributor

As an example

https://www.ebi.ac.uk/spot/zooma/v2/api/services/annotate?propertyValue=fatty+acids+%28200+micromolar%29&propertyType=treatment&filter=required:[atlas,gwas],preferred:[atlas,gwas],ontologies:[efo]

results in the following error:
ZOOMA encountered a problem that it could not recover from (Failed to complete a search for 'fatty acids (200 micromolar)' (java.util.regex.PatternSyntaxException: Unmatched closing ')' near index 9 micromolar) ^))

@warrenread
Copy link

warrenread commented Oct 16, 2019

https://www.ebi.ac.uk/spot/zooma/v2/api/services/annotate?propertyValue=fatty+acids+%92%28200+micromolar%92%29&propertyType=treatment&filter=required:[atlas,gwas],preferred:[atlas,gwas],ontologies:[efo]

Backslash (here urlencoded as %92) seems to fix the problem, which is to do with passing a regex where the brackets are meant to be interpreted literally as opposed to being directives to the regex. Backslash also seems to work when hard-encoded, but only if the whole URL is enlosed in quotes when invoking URL with curl on the command line. So probably safer to urlencode?

@henrietteharmse
Copy link
Contributor Author

The problem is that it forces Zooma users who often get the data from various upstream providers to parse the annotations and insert the backslash. Therefore, it might be something we want to do on our side.

@warrenread
Copy link

Might they want to pass an actual regex though? I'm guessing that's unlikely, and that a back-end fix (i.e. on our side) that brute-forces all opening and closing parentheses to backslash-escaped literals is indeed, probably, the right approach.

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