Summary
Implement SPARQL 1.1 solution sequence partitioning (GROUP BY), aggregate computation (COUNT, SUM, AVG, MIN, MAX, SAMPLE, GROUP_CONCAT), and post-aggregation filtering (HAVING) in core.next.query.
Objectives and Technical Scope
1. Solution Sequence Grouping (GROUP BY)
- Partition incoming solution sequences into multiset groups according to key variables or expressions.
- Support implicit single-group aggregation when aggregate functions are present without an explicit
GROUP BY.
2. Aggregate Functions
- Implement stateful aggregate evaluators:
COUNT(?var), COUNT(*), COUNT(DISTINCT ?var).
SUM(?var), SUM(DISTINCT ?var).
AVG(?var), AVG(DISTINCT ?var).
MIN(?var), MAX(?var).
SAMPLE(?var).
GROUP_CONCAT(?var; separator="..."), GROUP_CONCAT(DISTINCT ?var; separator="...").
3. Post-Aggregation Filtering (HAVING) and Projection Rules
- Evaluate boolean filter expressions over computed group aggregate states in
HAVING.
- Enforce SPARQL 1.1 projection constraints (only grouped variables or aggregate expressions in
SELECT).
4. Validation and Conformance
- Validate against official W3C SPARQL 1.1 test suites (
aggregates, grouping, having) in corese-w3c.
Dependencies
Summary
Implement SPARQL 1.1 solution sequence partitioning (
GROUP BY), aggregate computation (COUNT,SUM,AVG,MIN,MAX,SAMPLE,GROUP_CONCAT), and post-aggregation filtering (HAVING) incore.next.query.Objectives and Technical Scope
1. Solution Sequence Grouping (GROUP BY)
GROUP BY.2. Aggregate Functions
COUNT(?var),COUNT(*),COUNT(DISTINCT ?var).SUM(?var),SUM(DISTINCT ?var).AVG(?var),AVG(DISTINCT ?var).MIN(?var),MAX(?var).SAMPLE(?var).GROUP_CONCAT(?var; separator="..."),GROUP_CONCAT(DISTINCT ?var; separator="...").3. Post-Aggregation Filtering (HAVING) and Projection Rules
HAVING.SELECT).4. Validation and Conformance
aggregates,grouping,having) incorese-w3c.Dependencies