Skip to content

Grouped queries: trailing VALUES after HAVING, select * under grouping, and an indexed DESCRIBE test #2088

Open

Description

@aaj3f

What's left of grouping semantics after #2006. The first item is a deliberate, documented deviation, so it needs a decision before code; the rest are smaller.

  • Trailing VALUES joins before grouping, not after HAVING. SPARQL 1.1 §18.2.4.3 joins a trailing VALUES after HAVING; we join it with the WHERE solutions before grouping, documented as a deviation in docs/reference/compatibility.md (a commit on fix(query): evaluate grouped SELECT expressions once per group #2006 moved it after HAVING, and it was reverted). Aligning it changes the answers of the "VALUES as a parameter" idiom, so it'd be its own change with release notes, at the top level and in sub-SELECTs. A sub-SELECT would also need a post-HAVING VALUES slot on SubqueryPattern, honored by every grouped-sub-query fast path and rewrite. Needs a decision.
  • DESCRIBE with a trailing VALUES on an indexed ledger. Now that fix(query): BIND and UNWIND do not wait for the patterns that bind their target #2013 has landed, add the indexed-ledger case to construct_and_describe_read_a_trailing_values's DESCRIBE checks (SPARQL, both lanes), asserting the described graph. The test runs on a memory ledger only today, because single-target DESCRIBE returned an empty graph on an indexed ledger until fix(query): BIND and UNWIND do not wait for the patterns that bind their target #2013.
  • JSON-LD select * under groupBy depends on the grouping lane. On the streaming lane it returns the keys and aggregates; on the GroupByOperator lane, the per-group lists too (pre-existing), and the stream follows it. One answer for both.

From #2006 (Follow-ups: trailing VALUES spec alignment; DESCRIBE with a trailing VALUES on an indexed ledger; select * under groupBy).

Activity

  1. added
    bug
    P3
    triage:needs-decision
    area:sparql
    on Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3area:sparqlbugtriage:needs-decision

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions