Peter

Jena has supported SUM() for a long time (not sure exactly when) and also
includes AVG() both of which are part of the SPARQL 1.1 specification.

I am not sure what jena-arq-Percentile-2.11.1.jar is (never seen that JAR
before) so are you getting the Jena downloads from some third party source?

The current Jena release is 3.0.0 which requires Java 8, if you need to
stick with Java 7 then you can use 2.13.0 but that is not being actively
maintained.  So I would first suggest you upgrade to a more recent version

If you are stuck with an old version then the issue is likely that older
versions did not default to SPARQL 1.1 syntax by default so you had to
explicitly tell ARQ that your query was a SPARQL 1.1 query e.g.

Query q = QueryFactory.create(query, Syntax.syntaxSPARQL_11);

However I would still strongly recommend you upgrade to a newer Jena
version if at all possible

Rob

On 14/10/2015 13:56, "Wetz Peter" <[email protected]> wrote:

>Dear all,
>
>I am using an app, which uses Jena under the hood.
>
>In the app, I can create SPARQL queries. I want to create a SPARQL query
>which uses the AVG() aggregate function. However, when I include AVG() in
>my query, it yields no results.
>
>I can use COUNT() and it works. But I cannot use SUM(). If SUM() would
>work, I could calculate AVG() on my own.
>
>There are two solutions in my opinion:
>1) Since I read somewhere, that Jena should typically support SUM(), I
>would like to find out why it seems not to work for me. Maybe someone
>here can help to identify the reason?
>The app, uses the following libraries from jena (when did Jena ARQ start
>to support SUM()?):
>jena-arq-Percentile-2.11.1.jar
>jena-core-2.11.1.jar
>jena-iri-1.0.1.jar
>jena-tdb-1.0.1.jar
>
>2) Implement my own aggregate, that is, AVG(): Since I think, I am not
>the first person in the world which needs AVG() in Jena, I think there
>should already be the solution out there somewhere? Help is appreciated.
>
>Best regards,
>Peter




Reply via email to