-
Notifications
You must be signed in to change notification settings - Fork 66
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
FILTER keyword for latest anchor queries (grammar/lexer/hooks) #149
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced Oct 5, 2020
Open
jlsotomayorm
reviewed
Oct 6, 2020
jlsotomayorm
reviewed
Oct 6, 2020
jlsotomayorm
reviewed
Oct 6, 2020
jlsotomayorm
reviewed
Oct 6, 2020
jlsotomayorm
reviewed
Oct 6, 2020
jlsotomayorm
reviewed
Oct 6, 2020
thiagovas
approved these changes
Oct 7, 2020
jlsotomayorm
approved these changes
Oct 8, 2020
…estWhereFilterClauseHookError"
0cb4d4e
to
13e02b0
Compare
This was referenced Nov 18, 2020
Open
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR comes as the first step on #129, starting to set up a
FILTER
keyword in BadWolf at the grammar, lexer and hooks levels. The firstFILTER
function chosen to be implemented is thelatest
one, to solve what was requested by #86.It would be very useful to have in BQL a
FILTER
keyword that could allow us to filter out part of the results of a query in a level closer to the storage (closer to the driver), improving performance. This is exactly what this PR starts to introduce, setting up the foundations for this keyword in the grammar, lexer and hooks.The final objective is to allow the user to specify, inside of
WHERE
, which bindings they want to apply aFILTER
to, proceeding with a more fine-grained lookup on storage, avoiding unnecessary retrieval of data and optimizing query performance.To illustrate, queries such as the one below will in the future be possible:
That would return all the temporal triples of the
?test
graph that have the latest timestamp of the time series they are part of (a recorrent use case in BadWolf), skipping immutable triples found along the way.Regarding their position inside
WHERE
,FILTER
clauses must come after all the graph pattern clauses, just by the end of theWHERE
(closer to its closing bracket). Regarding trailing dots, aFILTER
clause is understood just like any other graph clause inside ofWHERE
: the trailing dot is mandatory at the end of each clause (FILTER
or graph ones indistinguishably), with the exception of the last one (for which the dot is optional).