-
Notifications
You must be signed in to change notification settings - Fork 56
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
Support triple patterns with zero variables #1395
Conversation
Let's feed this to the tools, and then implement the missing unit tests.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1395 +/- ##
==========================================
+ Coverage 89.64% 89.67% +0.02%
==========================================
Files 343 345 +2
Lines 29948 29942 -6
Branches 3314 3305 -9
==========================================
+ Hits 26848 26851 +3
+ Misses 1957 1949 -8
+ Partials 1143 1142 -1 ☔ View full report in Codecov by Sentry. |
# Conflicts: # src/engine/CMakeLists.txt
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.
Thorough 1-1 with Johannes, various smaller changes as discussed
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.
Second round, a very minor change left.
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.
Awesome!
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.
Indeed!
To add the missing unit tests.
Quality Gate passedIssues Measures |
So far, triple patterns in a query had to contain at least one variable. But the SPARQL 1.1 standard also supports triple patterns with no variables, like in
SELECT * WHERE { wd:Q42 wdt:P31 wd:Q5 ... }
. The semantics is that if the triple exists in the dataset, the triple pattern acts as the neutral element (that is, as if it weren't there), and if it does not exist in the dataset, it acts as the zero element (that is, the result of the whole graph pattern will be empty). This is now implemented, here is an example query: https://qlever.cs.uni-freiburg.de/wikidata/TkjahB . In particular, this fixes #835.As part of this fix, the code is refactored and simplified significantly, in particular:
The
ScanSpecification
class, which so far was used only in the index classes, now has a siblingScanSpecificationAsTripleComponent
, which is now also used in the class for theIndexScan
operation.Remove significant amounts of redundant code from the time, when index scans with one variable were executed (and cached) at query planning time. Remove the associated special case (used in testing), of an index scan without query execution context.