You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wikibase: <http://wikiba.se/ontology#>
#title:Medicines ordered by the most studied
SELECT ?main_subject (count(?item) as ?c)
WHERE
{
?item wdt:P31 wd:Q13442814;
wdt:P921 ?main_subject.
?main_subject wdt:P31/wdt:P279* wd:Q12140.
}
group by ?main_subject ?c
"Exception: BAD QUERY (Groupby variable ?main_subject is not groupable; in ../src/engine/GroupBy.cpp, line 704, function virtual void GroupBy::computeResult(ResultTable*))"
I agree with @hannahbast , I don't think it's valid to group by an aggregate (which is only derived from the first grouping). The error message is misleading, however, and that should be fixed.
dpriskorn
changed the title
Not groupable error on query that works on BlazeGraph
Misleading not groupable error on query that tries to group by an aggregate
Jan 30, 2022
Does anyone know why this fails?
"Exception: BAD QUERY (Groupby variable ?main_subject is not groupable; in ../src/engine/GroupBy.cpp, line 704, function virtual void GroupBy::computeResult(ResultTable*))"
Here is a similar query that works on WDQS
The text was updated successfully, but these errors were encountered: