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

Operator negation in AQL - part 3: complex non-existing structures #199

Open
thomaskrause opened this issue Sep 13, 2021 · 0 comments
Open

Comments

@thomaskrause
Copy link
Member

thomaskrause commented Sep 13, 2021

In addition to search for single non-existing operands for negated operators (described in #187), we might want to allow more complex structures to not exist.
E.g. in the query from #187 cat="NP" & cat="PP"? & #2 !> #1 additionally would be valid to bind the PP to other non-existent elements (with ?) as follows:

cat="NP" & cat="PP"? & #2 !> #1 & cat="S"? & #3 > #2

In this case, all NPs (=positive, existing elements without ?) are recovered, then we consider whether there exists the following potentially non-existent structure: cat="S"? > cat="PP"? (both with question marks). If such a structure dominates an NP, it is not a desired result.

Finally, note that queries binding non-existing and existing elements are invalid:

invalid:

cat="NP" & cat="PP?" & #2 !> #1 & cat="S" & #3 > #2

Here we are apparently saying that an NP is possibly not dominated by a PP, but that the PP is definitely dominated by an S, which we also want to have. This is impossible to evaluate, since in cases where the PP doesn't exist the S is ill-defined.

bors bot added a commit that referenced this issue Sep 16, 2021
200: Implement negation for non-existing nodes r=thomaskrause a=thomaskrause

This implements #187 but does not implement the more complex structures (as described in #199) yet. Also note that we changed form a prefix ? to a suffix, to make it easier to implement optional parts of the query term in the AQL parser later on when needed.

We implement these negated operators with non-existent operands as unary operators (with the existing node as the one that is filtered using the non-existent expression). There is also some refactoring and renaming to make it easier to use the value filter functions outside the conjunction code (in our operator) to avoid duplicated implementation of the node search logic.

Co-authored-by: Thomas Krause <thomaskrause@posteo.de>
Co-authored-by: Thomas Krause <krauseto@hu-berlin.de>
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

1 participant