I can not reproduce the error. When I execute this exact query on an (empty) repository, I get back a normal result.
Can you provide additional details about the error? What do the server logs say? Any stacktraces that might help me pinpoint the problem?
Can you attach a file with a minimal test dataset with which I can reproduce the error?
This is in the main.log file:
[ERROR] 2012-04-15 12:30:52,442 [repositories/OWMS] Error while handling request
java.lang.NullPointerException: null
at org.openrdf.query.algebra.UnaryValueOperator.hashCode(UnaryValueOperator.java:99)
at org.openrdf.query.algebra.Count.hashCode(Count.java:35)
at org.openrdf.query.algebra.GroupElem.hashCode(GroupElem.java:92)
at java.util.AbstractList.hashCode(AbstractList.java:527)
at org.openrdf.query.algebra.Group.hashCode(Group.java:150)
at org.openrdf.query.algebra.UnaryTupleOperator.hashCode(UnaryTupleOperator.java:104)
at org.openrdf.query.algebra.Extension.hashCode(Extension.java:123)
at org.openrdf.query.algebra.UnaryTupleOperator.hashCode(UnaryTupleOperator.java:104)
at org.openrdf.query.algebra.Projection.hashCode(Projection.java:98)
at java.util.HashMap.put(HashMap.java:372)
at org.openrdf.query.algebra.evaluation.impl.QueryJoinOptimizer$JoinVisitor.meet(QueryJoinOptimizer.java:89)
at org.openrdf.query.algebra.Join.visit(Join.java:51)
at org.openrdf.query.algebra.UnaryTupleOperator.visitChildren(UnaryTupleOperator.java:79)
at org.openrdf.query.algebra.Extension.visitChildren(Extension.java:101)
at org.openrdf.query.algebra.helpers.QueryModelVisitorBase.meetNode(QueryModelVisitorBase.java:633)
at org.openrdf.query.algebra.helpers.QueryModelVisitorBase.meetUnaryTupleOperator(QueryModelVisitorBase.java:534)
at org.openrdf.query.algebra.helpers.QueryModelVisitorBase.meet(QueryModelVisitorBase.java:194)
at org.openrdf.query.algebra.Extension.visit(Extension.java:90)
at org.openrdf.query.algebra.UnaryTupleOperator.visitChildren(UnaryTupleOperator.java:79)
at org.openrdf.query.algebra.MultiProjection.visitChildren(MultiProjection.java:112)
at org.openrdf.query.algebra.helpers.QueryModelVisitorBase.meetNode(QueryModelVisitorBase.java:633)
at org.openrdf.query.algebra.helpers.QueryModelVisitorBase.meetUnaryTupleOperator(QueryModelVisitorBase.java:534)
at org.openrdf.query.algebra.helpers.QueryModelVisitorBase.meet(QueryModelVisitorBase.java:344)
at org.openrdf.query.algebra.MultiProjection.visit(MultiProjection.java:101)
at org.openrdf.query.algebra.UnaryTupleOperator.visitChildren(UnaryTupleOperator.java:79)
at org.openrdf.query.algebra.helpers.QueryModelVisitorBase.meetNode(QueryModelVisitorBase.java:633)
at org.openrdf.query.algebra.helpers.QueryModelVisitorBase.meetUnaryTupleOperator(QueryModelVisitorBase.java:534)
at org.openrdf.query.algebra.helpers.QueryModelVisitorBase.meet(QueryModelVisitorBase.java:404)
at org.openrdf.query.algebra.Reduced.visit(Reduced.java:28)
at org.openrdf.query.algebra.UnaryTupleOperator.visitChildren(UnaryTupleOperator.java:79)
at org.openrdf.query.algebra.helpers.QueryModelVisitorBase.meetNode(QueryModelVisitorBase.java:633)
at org.openrdf.query.algebra.helpers.QueryModelVisitorBase.meet(QueryModelVisitorBase.java:398)
at org.openrdf.query.algebra.QueryRoot.visit(QueryRoot.java:34)
at org.openrdf.query.algebra.evaluation.impl.QueryJoinOptimizer.optimize(QueryJoinOptimizer.java:52)
at org.openrdf.sail.memory.MemoryStoreConnection.evaluateInternal(MemoryStoreConnection.java:136)
at org.openrdf.sail.helpers.SailConnectionBase.evaluate(SailConnectionBase.java:230)
at org.openrdf.sail.helpers.SailConnectionWrapper.evaluate(SailConnectionWrapper.java:82)
at org.openrdf.sail.inferencer.InferencerConnectionWrapper.evaluate(InferencerConnectionWrapper.java:103)
at org.openrdf.repository.sail.SailGraphQuery.evaluate(SailGraphQuery.java:53)
at org.openrdf.http.server.repository.RepositoryController.handleRequestInternal(RepositoryController.java:124)
at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:807)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:680)
The small dataset with which it happens.
The enviornment in which it is happening:
- apache-tomcat-6.0.32 on Mac OS X Lion 10.7.3 (11D50)
apache-tomcat started with -XX:MaxPermSize=1024m
OWMS is an in-memory store (RDF schema) with persistence.
It works in tomcat apache-tomcat-7.0.14.
Thanks, that stacktrace is helpful. Rather peculiar that the Apache Tomcat version seems to matter.
Query works when executed directly on an in memory store directly from console, so indeed the issue seems to be server or workbench application.
Slight amendment. Query seems to have significant performance issues when executed on an inferencing store. this occurs in the console when run directly on a store as well as when running from workbench against a server running on tomcat.
Will try to simplify query to isolate the cause.
I have noticed that the query which you execute seems to have a lot of redundancies in it. Especially given that you are executing this on a repository which supports RDFS inferencing.
For example, this subquery:
SELECT ( count(?a) as ?geos ) WHERE { ?a a ?type. ?type rdfs:subClassOf+ dcterms:Location. }
can be simplified to:
SELECT ( count(?a) as ?geos ) WHERE { ?a a dcterms:Location. }
The original subquery makes sense on a store that does not support RDFS inferencing, since we then need the property path to explore the transitive subclassof relation. But in an RDFS-inferencing store, transitivity is supported out of the box, so we don't need to explicitly query for it.
Of course, regardless, the query should perform better than it does, I will continue to look into the problem, but I thought I'd point this out.
The cause of the observed performance issue was a bug in the cycle detection for property paths having a fixed start and end value and iterating over a path that is both transitive and reflexive (e.g. a subclassof hierarchy). See
SES-993. This bug has been fixed and the query now seems to evaluate quickly and correctly, at least from the command line. Will doublecheck behavior in Tomcat setting.
Query now executes quickly and correctly in reported environment (Tomcat 6, in memory store with inferencing).
The fix will be included in the upcoming 2.6.6 release and in the next snapshot build.