-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support triple patterns with zero variables (#1395)
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 sibling ScanSpecificationAsTripleComponent, which is now also used in the class for the IndexScan 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.
- Loading branch information
Showing
33 changed files
with
521 additions
and
308 deletions.
There are no files selected for viewing
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,9 +2,7 @@ | |
// Chair of Algorithms and Data Structures. | ||
// Author: Johannes Kalmbach <[email protected]> | ||
|
||
#ifndef QLEVER_CARTESIANPRODUCTJOIN_H | ||
#define QLEVER_CARTESIANPRODUCTJOIN_H | ||
|
||
#pragma once | ||
#include "engine/Operation.h" | ||
#include "engine/QueryExecutionTree.h" | ||
|
||
|
@@ -92,5 +90,3 @@ class CartesianProductJoin : public Operation { | |
std::span<const Id> inputColumn, size_t groupSize, | ||
size_t offset); | ||
}; | ||
|
||
#endif // QLEVER_CARTESIANPRODUCTJOIN_H |
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 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 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 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 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
Oops, something went wrong.