You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by "Rob Vesse (JIRA)" <ji...@apache.org> on 2015/01/13 13:21:35 UTC

[jira] [Commented] (JENA-803) Custom aggregates in SPARQL.

    [ https://issues.apache.org/jira/browse/JENA-803?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14275127#comment-14275127 ] 

Rob Vesse commented on JENA-803:
--------------------------------

Started updating some code that works with aggregates to test these changes and ran into an interesting bug.  An {{AVG(DISTINCT ?x)}} gets turned into a regular {{AVG(?x)}} by the optimiser.

Starting query:

{noformat}
SELECT (COUNT(DISTINCT ?o) AS ?objects) (AVG(DISTINCT ?o) AS ?average) WHERE { ?s ?p ?o }
{/noformat}

Raw algebra:

{noformat}
(extend ((?average ?.1))
  (extend ((?objects ?.0))
    (group () ((?.0 (count distinct ?o)) (?.1 (avg distinct ?o)))
      (bgp (triple ?s ?p ?o)))))
{noformat}

Optimised algebra:

{noformat}
(extend ((?objects ?.0) (?average ?.1))
  (group () ((?.0 (count distinct ?o)) (?.1 (avg ?o)))
    (bgp (triple ?s ?p ?o))))
{noformat}

> Custom aggregates in SPARQL.
> ----------------------------
>
>                 Key: JENA-803
>                 URL: https://issues.apache.org/jira/browse/JENA-803
>             Project: Apache Jena
>          Issue Type: New Feature
>          Components: ARQ
>    Affects Versions: Jena 2.12.1
>            Reporter: Andy Seaborne
>            Assignee: Andy Seaborne
>             Fix For: Jena 2.12.2
>
>
> Support SPARQL custom aggregates.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)