-
Notifications
You must be signed in to change notification settings - Fork 1
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 2: negation without existence assumption #187
Comments
@amir-zeldes I'm almost finished implementing this in PR #200, but I changed the syntax from a prefix The motivation to change this is:
|
Wow, this is amazing!! The notation seems OK to me - the only disadvantage is the graphical dissimilarity of the case with key=val vs. just key, since "?" is sometimes adjacent to the key name and sometimes not: key? But I agree with your reasoning. Also note that #199 still has an example of the prefix notation. Fantastic work implementing this, I really want to switch to ANNIS4 now! |
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 <[email protected]> Co-authored-by: Thomas Krause <[email protected]>
This enhancement extends #186 , negation with existence assumption, and should probably be implemented after that issue is closed.
Often, we want a negative search to confirm that some element does not interact with our data in some way. This element doesn't have to exist: we just want to make sure it is not there (i.e. nothing, the empty set is fine as fulfilling the place of #n). This probably requires a "where not exists..." clause in the SQL generation.
It will be necessary to mark potentially non-existent elements in AQL. This will be done by suffixing a ? to the search expression. Here are some examples: suppose we want to find all NPs not dominated by a PP. It is not the case that a PP needs to be found and then checked for dominance of the NP. We simply want to go over everyone who dominates the NP (if at all) and make sure that none of them are PPs. We therefore explicitly state that we are not really searching for the PP. Note that the PP cannot be bound to the positive nodes in the query (those without ?) - otherwise its existence is implied and the solution in #186 applies. Here is the query:
This finds all NPs, then checks whether a cat="PP" exists which dominates them. If so, they are removed from the result set.
In the context of this issue, only simple annotation searches are valid as operands of the negated operator. It is not possible to connect two optional elements with a negated or non-negated operators. More complex structures would be introduced by #199 .
The text was updated successfully, but these errors were encountered: