hartig commented on PR #2501:
URL: https://github.com/apache/jena/pull/2501#issuecomment-2147634229

   > > [@SimonBin] Precisely because the GeoSPARQL 1.1/1.2 aggregate functions 
would also greatly benefit from being able to ORDER BY and UNFOLD in certain 
ways, I believe we should take some extra thought while designing the final 
version of this SEP
   >
   > [@afs] I would suggest that a proposal be developed - which can be a Jena 
change if having a concrete implementation that community can engage with. We 
just have to be clear what is experimental/subject to change and what is stable.
   
   Regarding ORDER BY for aggregate functions, I think everything needed for 
such a proposal is already covered by our SPARQL CDTs approach:
   * In terms of relevant spec text, our SPARQL CDTs spec introduces an algebra 
operator needed for it (see 
[OrderGroups](https://awslabs.github.io/SPARQL-CDTs/spec/latest.html#defn_algOrderGroups)
 in [Section 
11.3](https://awslabs.github.io/SPARQL-CDTs/spec/latest.html#ordergroups-algebra)
 and [Section 
11.4](https://awslabs.github.io/SPARQL-CDTs/spec/latest.html#ordergroups-semantics),
 as well as the corresponding extension to the AST-to-algebra translation 
algorithm (see [Section 
11.2](https://awslabs.github.io/SPARQL-CDTs/spec/latest.html#fold-translation)).
 I created these parts in a way that they can be integrated as is into the 
SPARQL-QUERY spec.
   * In terms of implementation, everything needed is in this PR. In particular,
      *  
[`main.jj`](https://github.com/apache/jena/pull/2501/files#diff-4d6097b4cd35d9151c6ba077f356ceb6b7aaa8f422b2787a2d464a9298581235)
 extends the grammar based on which the SPARQL parser code is generated (the 
relevant parts here are the new `OrderConditionForAggregationFunction()` 
function and its use for the new FOLD aggregate), and
      * 
[`AggFoldList`](https://github.com/apache/jena/pull/2501/files#diff-d7ca7d8431138177f06bca3562e7bea1493f76ad9b722b91a63a61c22172bc8a)
 and 
[`AggFoldMap`](https://github.com/apache/jena/pull/2501/files#diff-48ed975e88f628f3eee61652eda8a0e378c2270c440a4e4c646759757d31c750)
 are the actual `Aggregator` implementations which include corresponding 
`Accumulator` implementations that take care of the sorting (probably this may 
be split out into a base class between `AggregatorBase` and 
`AggFoldList`/`AggFoldMap`, or integrated directly into `AggregatorBase`).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: pr-unsubscr...@jena.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscr...@jena.apache.org
For additional commands, e-mail: pr-h...@jena.apache.org

Reply via email to