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

Grouping by a COUNT() not supported #253

Closed
niklas88 opened this issue Jun 7, 2019 · 2 comments
Closed

Grouping by a COUNT() not supported #253

niklas88 opened this issue Jun 7, 2019 · 2 comments
Labels
spec research Needs spec research

Comments

@niklas88
Copy link
Member

niklas88 commented Jun 7, 2019

From a Wikidata query example subquery:

PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX schema: <http://schema.org/>
SELECT DISTINCT ?path (COUNT(?pwPart) AS ?genes) WHERE {
   ?path wdt:P2410 ?WikipathsID .
   ?path wdt:P527 ?pwPart .
   ?pwPart wdt:P31 wd:Q7187 .
}
GROUP BY ?path ?genes

And on Scientists:

SELECT DISTINCT ?sc (COUNT(?partner) as ?partners) WHERE {
   ?sc <is-a> <Scientist> .
   ?sc <Spouse_(or_domestic_partner)> ?partner .
}
GROUP BY ?sc ?partners

The last log message before the crash is the following warning

WARN:  Group by variable ?partners is not part of the query.
@niklas88 niklas88 added the bug label Jun 7, 2019
@niklas88
Copy link
Member Author

niklas88 commented Jun 7, 2019

So thinking about this, it's a bit weird as the COUNT() is counted over the groups. In Blazegraph it looks like GROUP BY ?path ?genes in the example above is exactly the same as GROUP BY ?path. Also these results contain the same count twice so definitely don't group by it.

@niklas88 niklas88 added spec research Needs spec research and removed bug labels Jun 7, 2019
@niklas88 niklas88 changed the title Grouping by a COUNT() crashes Grouping by a COUNT() not supported Jul 19, 2019
@hannahbast
Copy link
Member

That is not a valid SPARQL query and QLever now indeed returns an error message saying that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
spec research Needs spec research
Projects
None yet
Development

No branches or pull requests

2 participants