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

See if the query parser (developed with antlr4) can be more lenient with brackets #327

Open
tloubrieu-jpl opened this issue Apr 28, 2023 · 2 comments

Comments

@tloubrieu-jpl
Copy link
Member

💡 Description

Especially, could we make it accept q query without surrounding brackets, e.g. for query:

    ((geom:Distances_Specific.geom:spacecraft_heliocentric_distance gt 160000000) and (geom:Distances_Specific.geom:spacecraft_heliocentric_distance lt 180000000))

We would also accept:

    (geom:Distances_Specific.geom:spacecraft_heliocentric_distance gt 160000000) and (geom:Distances_Specific.geom:spacecraft_heliocentric_distance lt 180000000)

See ticket NASA-PDS/pds-api#259

@alexdunnjpl
Copy link
Contributor

@tloubrieu-jpl what's the intended behaviour, precisely?

If we want to implement parenless operator precedence, that's probably complicated on both implementation and user sides, and not desirable imho.

If the only case this is intended to cover is "If the user writes an invalid query which would be valid if they'd remembered an all-enclosing/outermost set of parens", then I think that's an uncomplicated value-add for the user and it's also trivial to implement (just transform every user-supplied query string with an additional set of parens). These will probably get parsed out if they're redundant, but if not it's still trivial to only transform query strings that aren't enclosed.

@tloubrieu-jpl
Copy link
Member Author

Let's discuss that at a later breakout, there is no high priority associated to this ticket.

We just need to support missing parenthesis around a full expression I believe. One simple way to do that could be to add that automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: ToDo
Development

No branches or pull requests

2 participants