This is more of a SPARQL question, so sorry, if it not perfectly fits here:
I wonder, if it's possible to use aggregates in SPARQL CONSTRUCT queries.

For instance, I have the following query:

    CONSTRUCT {
        ?s ei:number ?number .
    }
    FROM <http://example.org>
    WHERE {
        ?s ei:number ?number
    }

However, since `?number` has multiple solutions, I would like to calculate the 
aggregate. I tried it like this:

    CONSTRUCT {
        ?s ei:number AVG(?number) .
    }
    FROM <http://example.org>
    WHERE {
        ?s ei:number ?number
    }

The [SPARQL Query Validator][1] raises the following error:

    Encountered " "avg" "AVG "" at line 3, column 14.
    Was expecting one of:
         ...
        "true" ...
        "false" ...
         ...
        "(" ...
         ...
        "[" ...

Hence, my question is: (How) can I use aggregates in SPARQL CONSTRUCT queries 
efficiently?

Reply via email to