-
Notifications
You must be signed in to change notification settings - Fork 65
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
Make empty path return empty set when the graph is empty #1806
Conversation
@RobinTF Thanks, Robin, for looking into this. I don't quite understand the description. What exactly is this PR supposed to do? |
@hannahbast It's a bit hard to describe because it's a very rare case. It should fix a compliance test (which we will hopefully see once the builds finish). SELECT * WHERE {
VALUES ?a { 1 }
?a a? ?b
} Because it is run on an empty graph I hope this clears things up a bit. EDIT: |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1806 +/- ##
==========================================
+ Coverage 90.02% 90.06% +0.04%
==========================================
Files 396 396
Lines 37974 37992 +18
Branches 4262 4267 +5
==========================================
+ Hits 34185 34217 +32
+ Misses 2493 2491 -2
+ Partials 1296 1284 -12 ☔ View full report in Codecov by Sentry. |
@RobinTF Thanks for the clarification, I have revised the title and description accordingly. I have a follow-up question: What if the graph is not empty but does not contain the binding (or bindings) for And yet more specifically: If some of the bindings are in the graph and some or not, should the solution only contain those bindings that are in the graph? |
Yes, that's how I see it too. When there is a statement like EDIT: To clarify, it is not important where in the triple (subject or object position) the value is found for the empty path, as long as it is somewhere. |
maxDist_)); | ||
candidates.push_back(makeTransitivePath(getExecutionContext(), | ||
alternativeSubtree, lhs, rhs, | ||
minDist_, maxDist_, useBinSearch)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes a bug in the unit tests, where both implementations are supposed to get tested, but for bound variables it got reset to the configured default regardless of test configuration
@RobinTF OK, that's a completely new spin now. Are you saying that matches for the empty path have to be a subject or object of the underlying predicate or property path? That's not how Johannes and I understood this so far, but it's quite possible that we were wrong. Can you pinpoint from there exactly in the standard you are inferring this? |
Conformance check passed ✅Test Status Changes 📊
|
|
@hannahbast I had a look at some of the compliance tests and you're right. The values don't have to be related to the predicates. But this means that VALUES has just some arbitrary limitation that it doesn't count for property paths. In this case this has to be solved via query planning, by making sure the value is at least joined once with the index. |
When the graph is empty, the empty path should return an empty set, even when one of the two sides has a binding. For example, consider the following query on an empty graph. So far, QLever would return the binding
{ "?a": 1, "?b": 1 }
because the left size has the binding{ "?a": 1 }
. But the correct result is to return an empty solution set because the graph is empty. This is now fixed.