You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@marmotta.apache.org by Osma Suominen <os...@helsinki.fi> on 2016/09/26 06:38:35 UTC

SPARQL query fails on Marmotta 3.4.0-SNAPSHOT

Hi,


I noticed that the following SPARQL query, used to count the number of 
triples in different graphs, fails on the current 3.4.0-SNAPSHOT (using 
PostgreSQL 9.5 as backend, starting from an empty database). It works on 
3.3.0 using the same database.


--cut--
SELECT ?g (COUNT(*) AS ?c) {
   GRAPH ?g {
     ?s ?p ?o
   }
}
GROUP BY ?g
ORDER BY DESC(?c)
--cut--

The error in the Tomcat log is:


--cut--
09:32:30.101 ERROR - error while evaluating query: {}
org.openrdf.query.QueryEvaluationException: 
org.postgresql.util.PSQLException: ERROR: aggregate functions are not 
allowed in GROUP BY
   Position: 183
         at 
org.openrdf.repository.sail.SailTupleQuery.evaluate(SailTupleQuery.java:67)
         at 
org.openrdf.repository.sail.SailTupleQuery.evaluate(SailTupleQuery.java:75)
         at 
org.apache.marmotta.platform.sparql.services.sparql.SparqlServiceImpl.query(SparqlServiceImpl.java:344)
         at 
org.apache.marmotta.platform.sparql.services.sparql.SparqlServiceImpl.query(SparqlServiceImpl.java:351)
         at 
org.apache.marmotta.platform.sparql.services.sparql.SparqlServiceImpl.access$700(SparqlServiceImpl.java:60)
         at 
org.apache.marmotta.platform.sparql.services.sparql.SparqlServiceImpl$5.call(SparqlServiceImpl.java:290)
         at 
org.apache.marmotta.platform.sparql.services.sparql.SparqlServiceImpl$5.call(SparqlServiceImpl.java:279)
         at java.util.concurrent.FutureTask.run(FutureTask.java:266)
         at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
         at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
         at java.lang.Thread.run(Thread.java:745)
Caused by: org.openrdf.sail.SailException: 
org.postgresql.util.PSQLException: ERROR: aggregate functions are not 
allowed in GROUP BY
   Position: 183
         at 
org.apache.marmotta.kiwi.sparql.sail.KiWiSparqlSailConnection.evaluate(KiWiSparqlSailConnection.java:101)
         at 
org.openrdf.sail.helpers.SailConnectionWrapper.evaluate(SailConnectionWrapper.java:95)
         at 
org.openrdf.repository.sail.SailTupleQuery.evaluate(SailTupleQuery.java:60)
         ... 10 common frames omitted
Caused by: org.openrdf.query.QueryEvaluationException: 
org.postgresql.util.PSQLException: ERROR: aggregate functions are not 
allowed in GROUP BY
   Position: 183
         at 
org.apache.marmotta.kiwi.sparql.evaluation.KiWiEvaluationStrategy.evaluateNative(KiWiEvaluationStrategy.java:398)
         at 
org.apache.marmotta.kiwi.sparql.evaluation.KiWiEvaluationStrategy.evaluate(KiWiEvaluationStrategy.java:133)
         at 
org.openrdf.query.algebra.evaluation.impl.EvaluationStrategyImpl.evaluate(EvaluationStrategyImpl.java:616)
         at 
org.openrdf.query.algebra.evaluation.impl.EvaluationStrategyImpl.evaluate(EvaluationStrategyImpl.java:207)
         at 
org.openrdf.query.algebra.evaluation.impl.EvaluationStrategyImpl.evaluate(EvaluationStrategyImpl.java:687)
         at 
org.apache.marmotta.kiwi.sparql.evaluation.KiWiEvaluationStrategy.evaluate(KiWiEvaluationStrategy.java:108)
         at 
org.openrdf.query.algebra.evaluation.impl.EvaluationStrategyImpl.evaluate(EvaluationStrategyImpl.java:589)
         at 
org.openrdf.query.algebra.evaluation.impl.EvaluationStrategyImpl.evaluate(EvaluationStrategyImpl.java:207)
         at 
org.openrdf.query.algebra.evaluation.impl.EvaluationStrategyImpl.evaluate(EvaluationStrategyImpl.java:621)
         at 
org.openrdf.query.algebra.evaluation.impl.EvaluationStrategyImpl.evaluate(EvaluationStrategyImpl.java:207)
         at 
org.apache.marmotta.kiwi.sparql.sail.KiWiSparqlSailConnection.evaluate(KiWiSparqlSailConnection.java:98)
         ... 12 common frames omitted
Caused by: org.postgresql.util.PSQLException: ERROR: aggregate functions 
are not allowed in GROUP BY
   Position: 183
         at 
org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2161)
         at 
org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1890)
         at 
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)
         at 
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:560)
         at 
org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:417)
         at 
org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:302)
         at 
org.apache.marmotta.kiwi.sparql.evaluation.KiWiEvaluationStrategy$1.call(KiWiEvaluationStrategy.java:217)
         at 
org.apache.marmotta.kiwi.sparql.evaluation.KiWiEvaluationStrategy$1.call(KiWiEvaluationStrategy.java:213)
         ... 4 common frames omitted
--cut--


Is this a known issue? I can of course open a JIRA ticket if necessary.

-Osma


-- 
Osma Suominen
D.Sc. (Tech), Information Systems Specialist
National Library of Finland
P.O. Box 26 (Kaikukatu 4)
00014 HELSINGIN YLIOPISTO
Tel. +358 50 3199529
osma.suominen@helsinki.fi
http://www.nationallibrary.fi

Re: SPARQL query fails on Marmotta 3.4.0-SNAPSHOT

Posted by Osma Suominen <os...@helsinki.fi>.
Thanks Sergio. Reported in JIRA: 
https://issues.apache.org/jira/browse/MARMOTTA-657

-Osma

26.09.2016, 10:01, Sergio Fern�ndez wrote:
> Osma, 3.4.0 introduces quite some changes in the SPARQL engine (mainly
> about performance), which could be not complete (that's why the release
> is taking that long). So please, report the details to Jira and we'll
> try to deal with it. Thanks.
>
> On Mon, Sep 26, 2016 at 8:38 AM, Osma Suominen
> <osma.suominen@helsinki.fi <ma...@helsinki.fi>> wrote:
>
>     Hi,
>
>
>     I noticed that the following SPARQL query, used to count the number
>     of triples in different graphs, fails on the current 3.4.0-SNAPSHOT
>     (using PostgreSQL 9.5 as backend, starting from an empty database).
>     It works on 3.3.0 using the same database.
>
>
>     --cut--
>     SELECT ?g (COUNT(*) AS ?c) {
>       GRAPH ?g {
>         ?s ?p ?o
>       }
>     }
>     GROUP BY ?g
>     ORDER BY DESC(?c)
>     --cut--
>
>     The error in the Tomcat log is:
>
>
>     --cut--
>     09:32:30.101 ERROR - error while evaluating query: {}
>     org.openrdf.query.QueryEvaluationException:
>     org.postgresql.util.PSQLException: ERROR: aggregate functions are
>     not allowed in GROUP BY
>       Position: 183
>             at org.openrdf.repository.sail.Sa
>     <http://org.openrdf.repository.sail.Sa>ilTupleQuery.evaluate(SailTupleQuery.java:67)
>             at org.openrdf.repository.sail.Sa
>     <http://org.openrdf.repository.sail.Sa>ilTupleQuery.evaluate(SailTupleQuery.java:75)
>             at
>     org.apache.marmotta.platform.sparql.services.sparql.SparqlServiceImpl.query(SparqlServiceImpl.java:344)
>             at
>     org.apache.marmotta.platform.sparql.services.sparql.SparqlServiceImpl.query(SparqlServiceImpl.java:351)
>             at
>     org.apache.marmotta.platform.sparql.services.sparql.SparqlServiceImpl.access$700(SparqlServiceImpl.java:60)
>             at
>     org.apache.marmotta.platform.sparql.services.sparql.SparqlServiceImpl$5.call(SparqlServiceImpl.java:290)
>             at
>     org.apache.marmotta.platform.sparql.services.sparql.SparqlServiceImpl$5.call(SparqlServiceImpl.java:279)
>             at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>             at
>     java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>             at
>     java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>             at java.lang.Thread.run(Thread.java:745)
>     Caused by: org.openrdf.sail.SailException:
>     org.postgresql.util.PSQLException: ERROR: aggregate functions are
>     not allowed in GROUP BY
>       Position: 183
>             at
>     org.apache.marmotta.kiwi.sparql.sail.KiWiSparqlSailConnection.evaluate(KiWiSparqlSailConnection.java:101)
>             at
>     org.openrdf.sail.helpers.SailConnectionWrapper.evaluate(SailConnectionWrapper.java:95)
>             at org.openrdf.repository.sail.Sa
>     <http://org.openrdf.repository.sail.Sa>ilTupleQuery.evaluate(SailTupleQuery.java:60)
>             ... 10 common frames omitted
>     Caused by: org.openrdf.query.QueryEvaluationException:
>     org.postgresql.util.PSQLException: ERROR: aggregate functions are
>     not allowed in GROUP BY
>       Position: 183
>             at
>     org.apache.marmotta.kiwi.sparql.evaluation.KiWiEvaluationStrategy.evaluateNative(KiWiEvaluationStrategy.java:398)
>             at
>     org.apache.marmotta.kiwi.sparql.evaluation.KiWiEvaluationStrategy.evaluate(KiWiEvaluationStrategy.java:133)
>             at
>     org.openrdf.query.algebra.evaluation.impl.EvaluationStrategyImpl.evaluate(EvaluationStrategyImpl.java:616)
>             at
>     org.openrdf.query.algebra.evaluation.impl.EvaluationStrategyImpl.evaluate(EvaluationStrategyImpl.java:207)
>             at
>     org.openrdf.query.algebra.evaluation.impl.EvaluationStrategyImpl.evaluate(EvaluationStrategyImpl.java:687)
>             at
>     org.apache.marmotta.kiwi.sparql.evaluation.KiWiEvaluationStrategy.evaluate(KiWiEvaluationStrategy.java:108)
>             at
>     org.openrdf.query.algebra.evaluation.impl.EvaluationStrategyImpl.evaluate(EvaluationStrategyImpl.java:589)
>             at
>     org.openrdf.query.algebra.evaluation.impl.EvaluationStrategyImpl.evaluate(EvaluationStrategyImpl.java:207)
>             at
>     org.openrdf.query.algebra.evaluation.impl.EvaluationStrategyImpl.evaluate(EvaluationStrategyImpl.java:621)
>             at
>     org.openrdf.query.algebra.evaluation.impl.EvaluationStrategyImpl.evaluate(EvaluationStrategyImpl.java:207)
>             at
>     org.apache.marmotta.kiwi.sparql.sail.KiWiSparqlSailConnection.evaluate(KiWiSparqlSailConnection.java:98)
>             ... 12 common frames omitted
>     Caused by: org.postgresql.util.PSQLException: ERROR: aggregate
>     functions are not allowed in GROUP BY
>       Position: 183
>             at
>     org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2161)
>             at
>     org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1890)
>             at
>     org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)
>             at
>     org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:560)
>             at
>     org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:417)
>             at
>     org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:302)
>             at
>     org.apache.marmotta.kiwi.sparql.evaluation.KiWiEvaluationStrategy$1.call(KiWiEvaluationStrategy.java:217)
>             at
>     org.apache.marmotta.kiwi.sparql.evaluation.KiWiEvaluationStrategy$1.call(KiWiEvaluationStrategy.java:213)
>             ... 4 common frames omitted
>     --cut--
>
>
>     Is this a known issue? I can of course open a JIRA ticket if necessary.
>
>     -Osma
>
>
>     --
>     Osma Suominen
>     D.Sc. (Tech), Information Systems Specialist
>     National Library of Finland
>     P.O. Box 26 (Kaikukatu 4)
>     00014 HELSINGIN YLIOPISTO
>     Tel. +358 50 3199529 <tel:%2B358%2050%203199529>
>     osma.suominen@helsinki.fi <ma...@helsinki.fi>
>     http://www.nationallibrary.fi
>
>
>
>
> --
> Sergio Fern�ndez
> Partner Technology Manager
> Redlink GmbH
> m: +43 6602747925
> e: sergio.fernandez@redlink.co <ma...@redlink.co>
> w: http://redlink.co <http://redlink.co/>


-- 
Osma Suominen
D.Sc. (Tech), Information Systems Specialist
National Library of Finland
P.O. Box 26 (Kaikukatu 4)
00014 HELSINGIN YLIOPISTO
Tel. +358 50 3199529
osma.suominen@helsinki.fi
http://www.nationallibrary.fi

Re: SPARQL query fails on Marmotta 3.4.0-SNAPSHOT

Posted by Sergio Fernández <wi...@apache.org>.
Osma, 3.4.0 introduces quite some changes in the SPARQL engine (mainly
about performance), which could be not complete (that's why the release is
taking that long). So please, report the details to Jira and we'll try to
deal with it. Thanks.

On Mon, Sep 26, 2016 at 8:38 AM, Osma Suominen <os...@helsinki.fi>
wrote:

> Hi,
>
>
> I noticed that the following SPARQL query, used to count the number of
> triples in different graphs, fails on the current 3.4.0-SNAPSHOT (using
> PostgreSQL 9.5 as backend, starting from an empty database). It works on
> 3.3.0 using the same database.
>
>
> --cut--
> SELECT ?g (COUNT(*) AS ?c) {
>   GRAPH ?g {
>     ?s ?p ?o
>   }
> }
> GROUP BY ?g
> ORDER BY DESC(?c)
> --cut--
>
> The error in the Tomcat log is:
>
>
> --cut--
> 09:32:30.101 ERROR - error while evaluating query: {}
> org.openrdf.query.QueryEvaluationException: org.postgresql.util.PSQLException:
> ERROR: aggregate functions are not allowed in GROUP BY
>   Position: 183
>         at org.openrdf.repository.sail.SailTupleQuery.evaluate(SailTupl
> eQuery.java:67)
>         at org.openrdf.repository.sail.SailTupleQuery.evaluate(SailTupl
> eQuery.java:75)
>         at org.apache.marmotta.platform.sparql.services.sparql.SparqlSe
> rviceImpl.query(SparqlServiceImpl.java:344)
>         at org.apache.marmotta.platform.sparql.services.sparql.SparqlSe
> rviceImpl.query(SparqlServiceImpl.java:351)
>         at org.apache.marmotta.platform.sparql.services.sparql.SparqlSe
> rviceImpl.access$700(SparqlServiceImpl.java:60)
>         at org.apache.marmotta.platform.sparql.services.sparql.SparqlSe
> rviceImpl$5.call(SparqlServiceImpl.java:290)
>         at org.apache.marmotta.platform.sparql.services.sparql.SparqlSe
> rviceImpl$5.call(SparqlServiceImpl.java:279)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPool
> Executor.java:1142)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoo
> lExecutor.java:617)
>         at java.lang.Thread.run(Thread.java:745)
> Caused by: org.openrdf.sail.SailException: org.postgresql.util.PSQLException:
> ERROR: aggregate functions are not allowed in GROUP BY
>   Position: 183
>         at org.apache.marmotta.kiwi.sparql.sail.KiWiSparqlSailConnectio
> n.evaluate(KiWiSparqlSailConnection.java:101)
>         at org.openrdf.sail.helpers.SailConnectionWrapper.evaluate(Sail
> ConnectionWrapper.java:95)
>         at org.openrdf.repository.sail.SailTupleQuery.evaluate(SailTupl
> eQuery.java:60)
>         ... 10 common frames omitted
> Caused by: org.openrdf.query.QueryEvaluationException:
> org.postgresql.util.PSQLException: ERROR: aggregate functions are not
> allowed in GROUP BY
>   Position: 183
>         at org.apache.marmotta.kiwi.sparql.evaluation.KiWiEvaluationStr
> ategy.evaluateNative(KiWiEvaluationStrategy.java:398)
>         at org.apache.marmotta.kiwi.sparql.evaluation.KiWiEvaluationStr
> ategy.evaluate(KiWiEvaluationStrategy.java:133)
>         at org.openrdf.query.algebra.evaluation.impl.EvaluationStrategy
> Impl.evaluate(EvaluationStrategyImpl.java:616)
>         at org.openrdf.query.algebra.evaluation.impl.EvaluationStrategy
> Impl.evaluate(EvaluationStrategyImpl.java:207)
>         at org.openrdf.query.algebra.evaluation.impl.EvaluationStrategy
> Impl.evaluate(EvaluationStrategyImpl.java:687)
>         at org.apache.marmotta.kiwi.sparql.evaluation.KiWiEvaluationStr
> ategy.evaluate(KiWiEvaluationStrategy.java:108)
>         at org.openrdf.query.algebra.evaluation.impl.EvaluationStrategy
> Impl.evaluate(EvaluationStrategyImpl.java:589)
>         at org.openrdf.query.algebra.evaluation.impl.EvaluationStrategy
> Impl.evaluate(EvaluationStrategyImpl.java:207)
>         at org.openrdf.query.algebra.evaluation.impl.EvaluationStrategy
> Impl.evaluate(EvaluationStrategyImpl.java:621)
>         at org.openrdf.query.algebra.evaluation.impl.EvaluationStrategy
> Impl.evaluate(EvaluationStrategyImpl.java:207)
>         at org.apache.marmotta.kiwi.sparql.sail.KiWiSparqlSailConnectio
> n.evaluate(KiWiSparqlSailConnection.java:98)
>         ... 12 common frames omitted
> Caused by: org.postgresql.util.PSQLException: ERROR: aggregate functions
> are not allowed in GROUP BY
>   Position: 183
>         at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorRespons
> e(QueryExecutorImpl.java:2161)
>         at org.postgresql.core.v3.QueryExecutorImpl.processResults(Quer
> yExecutorImpl.java:1890)
>         at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecut
> orImpl.java:255)
>         at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(Abstract
> Jdbc2Statement.java:560)
>         at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags
> (AbstractJdbc2Statement.java:417)
>         at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(Abs
> tractJdbc2Statement.java:302)
>         at org.apache.marmotta.kiwi.sparql.evaluation.KiWiEvaluationStr
> ategy$1.call(KiWiEvaluationStrategy.java:217)
>         at org.apache.marmotta.kiwi.sparql.evaluation.KiWiEvaluationStr
> ategy$1.call(KiWiEvaluationStrategy.java:213)
>         ... 4 common frames omitted
> --cut--
>
>
> Is this a known issue? I can of course open a JIRA ticket if necessary.
>
> -Osma
>
>
> --
> Osma Suominen
> D.Sc. (Tech), Information Systems Specialist
> National Library of Finland
> P.O. Box 26 (Kaikukatu 4)
> 00014 HELSINGIN YLIOPISTO
> Tel. +358 50 3199529
> osma.suominen@helsinki.fi
> http://www.nationallibrary.fi
>



-- 
Sergio Fernández
Partner Technology Manager
Redlink GmbH
m: +43 6602747925
e: sergio.fernandez@redlink.co
w: http://redlink.co