-
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
Correct handling of Datasets #1845
base: master
Are you sure you want to change the base?
Conversation
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.
Not quite finished yet, but we can already do an initial round.
expectDescribe( | ||
"Describe ?x FROM <g> { ?x ?y ?z FILTER EXISTS {?a ?b ?c}}", | ||
m::DescribeQuery( | ||
m::Describe({Var("?x")}, {datasets, {}}, | ||
m::SelectQuery(m::VariablesSelect({"?x"}, false, false), | ||
filterGraphPattern, datasets)), | ||
datasets)); |
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 test (and the equivalent one in SparqlParserTest
) currently fail because the Select doesn't have the datasets set. This seems to be the desired behaviour (SparqlQleverVisitor.cpp::398
):
NOTE: The dataset clauses are stored once in
parsedQuery_.datasetClauses_
(which pertains to the CONSTRUCT query that computes the result of the DESCRIBE), and once inparsedQuery_.describeClause_.datasetClauses_
(which pertains to the SELECT query that computes the resources to be described).
If that is so, then this note should be extended by this fact.
// TODO: is it a good idea to do this implicitly (the fields are nullopt) or | ||
// should this be done explicitly (with a bool flag)? | ||
if (!activeDatasetClauses_.defaultGraphs_.has_value() && | ||
!activeDatasetClauses_.namedGraphs_.has_value()) { | ||
activeDatasetClauses_ = parsedQuery::DatasetClauses::fromClauses(clauses); | ||
} | ||
return activeDatasetClauses_; |
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.
TODO: finish
|
Conformance check passed ✅No test result changes. |
EXISTS) in
SparqlAntlrParserTest`. Previously this was only tested indirectly in the QueryPlanerTest.Describe
matcher was changed slightly (it now matcherGraphPattern
for consistence with the other matchers).SparqlQleverVisitor
takes the override dataset clause in its constructor and if these contain datasets then the datasets in the query are ignored.SparqlParserTest
.TODO:
DESCRIBE
currently fail, because the datasets are not set in its contained select (code comments seem to indicate that this should be set)