Skip to content
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

Aggregates #29

Closed
dwhitney opened this issue Aug 30, 2019 · 5 comments
Closed

Aggregates #29

dwhitney opened this issue Aug 30, 2019 · 5 comments
Assignees
Labels
bug Something isn't working feature request We should implement this!

Comments

@dwhitney
Copy link
Contributor

Do aggregates actually work? I have tested them out and they don't seem to really do what's advertised. If this is not a known issue, I can provide some examples, but otherwise, are there plans to build this in?

TIA!

@Callidon
Copy link
Owner

Callidon commented Aug 31, 2019

Hi
Aggregates do work, but they require you to add a GROUP BY clause to the query. Otherwise, the framework will not return correct results.

So, for example, If you want to count all distinct subjects in a RDF dataset, you can use the following query:

SELECT (COUNT(DISTINCT ?s) AS ?c)
WHERE {
  ?s ?p ?o
}
GROUP BY ?s

I've planned to do a few more work on this project next week, I will put the "aggregates without group by" feature on my todo list ;)

@Callidon Callidon added bug Something isn't working feature request We should implement this! labels Aug 31, 2019
@Callidon Callidon self-assigned this Aug 31, 2019
@Callidon Callidon added this to the SPARQL 1.1 compliance milestone Aug 31, 2019
@Callidon
Copy link
Owner

Well, I've just pushed some modifications on the master branch that should allow SPARQL aggregates to work without adding a GROUP BY clause.

I will be glad if you could try it and provide some feedback.

@dwhitney
Copy link
Contributor Author

dwhitney commented Sep 3, 2019 via email

@dwhitney
Copy link
Contributor Author

AWESOME! I will try it out some time this week. Thanks!

@dwhitney
Copy link
Contributor Author

oh ha - old comment :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feature request We should implement this!
Projects
None yet
Development

No branches or pull requests

2 participants