-
Notifications
You must be signed in to change notification settings - Fork 23
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
Tests for aggregates when the pattern match is empty #61
Conversation
Without delving into my implementation to far, I get different results for agg-empty-group-1, agg-empty-group-count-01 and egg-empty-group-count-02, but I'm sure your reasoning is correct. For agg-empty-group-1, you expect no solutions, and I return a single solution with no bindings. For agg-empty-group-count-01, you expect a single solution with ?C bound to 0, and I get a single solution with no bindings. For agg-empty-group-count-02, you expect no solutions, and I get a single solution with no bindings. It would seem the the purpose of the test is to test for these types of differences. |
I agree with the analysis in your writeup. I also fail some of these tests; I think I lost track somewhere along the way of the original reasoning for the |
SWObjects gets the opposite answers from AFS on
|
ARQ has got this wrong multiple times - both with spec misreading and plain old bugs - and not just the "empty match" case. The principle I hope is acceptable is that "aggregate, no group-by => one row always", "aggregate, with group-by => same number of rows as the group-by" for empty and no-empty matching. The spec does not handle one case - "no match, aggregate, no group-by" - but I think does say that otherwise. |
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.
Comunica produces the following:
agg-empty-group-2.rq
error
agg-empty-group-2.rq
error
agg-empty-group-count-01.rq
?c: 0
agg-empty-group-count-02.rq
?c: 0
So only for agg-empty-group-count-01
, the result is the same.
I do however agree that the tests in this PR make sense, and we should update the implementation on our end.
I see a lot of reports on how implementations handle this, but it would be good to 👍 or 👎 to vote for merging this PR. I'm 👍 . |
…ressions, otherwise (not grouping), return a single solution binding aggregated variables. The principle is that "aggregate, no group-by => one row always", "aggregate, with group-by => same number of rows as the group-by" for empty and no-empty matching. See w3c/rdf-tests#61
|
The current naming is certainly in line with most other SPARQL test cases. Generally, they could all be more descriptive, but in my experience, this becomes difficult to maintain over time. Descriptions should go in the manifest
Which documents? The test suite just has a top-level index (other than the manifest comments). I agree that a future spec could describe more motivation behind unintuitive test behavior, perhaps using more enhanced examples, but that would be for a future WG to decide. The test names and comments could provide some more information on what is being tested, specifically. For example, the manifest entry for the new tests should probably have an Another possibility would be to add some description wherever the We could potentially also use |
my intent the change would be better if it does not depend on knowledge embedded in other documents. that will matter down the road. |
as well established as practices may be, that
does not recommend them. |
What's being discussed now doesn't seem to have anything to do with whether these tests should be included in the test suite. There seems to be agreement on that. Let's merge it, and anyone who wants to file a new PR to improve naming or descriptions/documentation can do that (as that is a topic that impacts more than just these new tests). |
If @afs would like to act on such feedback, it's up to him. Failing that, I suggest we just go ahead and merge. I may add some suggestions for comments inline to this PR. |
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.
I added some comments along the lines of @afs's explanation in #61 (comment). Please feel free to improve.
It seems to have been missed that SPARQL tests have a Thank you to @gkellogg for providing The file names for the changes to the original MAX cases replace existing tests so retaining names make some sense for discussions to show what is new and what is replacement. Just before merge, I can rename files. The "1" and "2" for the count tests could usefully be swapped. We need to ensure the PR comments are not too broken by this change so I suggest doing it at the last moment and also recording the change in the PR comments here. |
Co-authored-by: Gregg Kellogg <[email protected]>
Co-authored-by: Gregg Kellogg <[email protected]>
Co-authored-by: Gregg Kellogg <[email protected]>
Co-authored-by: Gregg Kellogg <[email protected]>
Thanks Andy, IMO, this substantially responds to the objections, and you're clear to go ahead and merge this PR. |
Commit c92f945 tidies up the manifest and puts in consistent naming of files:
The merge will squash the commits down to one. |
This PR replaces the aggregates/agg-empty-group test with 4 new tests: one each for the case of MAX and COUNT with and without GROUP BY.