-
Notifications
You must be signed in to change notification settings - Fork 37
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
LIKE operators #87
Comments
It seems from the issue #42 discussions that we have the following possibilities for querrying substrings:
Each has increasing expressive power, but also may be increasingly difficult to implement on back-ends without the native support (for instance, MySQL at some stage required a plug-in to support regexp searches). I suggest defining Filter language syntax and the following compatibility requirements:
In this way, all backends will provide the same basic STARTS/ENDS/CONTAINS functionality (which is easy to implement using LIKE of SQL, REGEXPs or even a post-filtering); but we will also be able to introduce efficient extensions in a compatible way. What others think? |
This issue was brought up by @ml-evs in today's Web meeting. @rartino asked the providers to express their opinions about it. Personally, I like the proposal to support different string matching languages (SQL LIKE, GLOB, PCRE etc). However, I think that here we again encounter the same dilemma where by allowing diversity among providers we transfer the burden onto the clients. I easily image every provider preferring a different string matching language, and only that one. SQL LIKE seems least demanding and, as such, least powerful. Maybe we can start from that and move on to the next ones? By the way, I would rename |
I would close the LIKE issue since we have STARTS/ENDS/CONTAINS for simple queries and REGEXP for advanced ones. The LIKE mechanism seems superfluous. Anybody against closing this issue? |
AFAIK, OPTIMADE does not support REGEXP mechanisms in filters yet. PR #490 only defined OPTIMADE regular expression format, but there is no way to filter using regular expressions. |
Yes indeed. But the REGEXP syntax is key to provide filtering. We should open a separate issue on REGEXP filtering, IMHO. |
Agree. We can close this issue then. |
I agree and the suggestion matches my view of what we have agreed to-- to skip "LIKE" and work the new REGEXP definition recently added as an appendix into the query language. There is a closed PR that in its final stage more or less did this (except referring to the appendix for the regex definition) adding a REGEX construct to the grammar; maybe we can recover the end state of that PR and continue from there. |
I'm closing this issue in favor of designing the REGEXP match from the blank sheet in #532 |
It has been suggested (Issue #42, PR #69) to have operator similar to SQL "LIKE" in a query language.
Since there are reservations about implementing 'LIKE "%string%"' construct as being too much geared towards a particular DB implementation, and 'LIKE "string"' would be inventing something superfluously similar to the SQL LIKE but different enough to be confusing, what about the following syntax:r
some_property MATCHES "*C*"
and interpret it as, say a Shell GLOB?
The idea is to have a query expression that is simpler and more widely supported in database engines than full-featured RegExps, but still useful for general substring searches,
The text was updated successfully, but these errors were encountered: