blazegraph / database

Blazegraph High Performance Graph Database
GNU General Public License v2.0
871 stars 170 forks source link

Construct query error (the construct should be correct) #187

Open FerrariAndrea opened 3 years ago

FerrariAndrea commented 3 years ago

Hi, I m using buildVersion=2.1.6-SNAPSHOT of blazegraph.

This query seams be bugged:

CONSTRUCT { <http://this> <http://type> <http://obj> ; <http://label> "This is a test" ; <http://where> <http://not.void> . } WHERE { ?s ?p ?o . <http://test> ?p ?o }

Blazegraph response:

ERROR: SPARQL-QUERY: queryStr=CONSTRUCT { ; "This is a test"; . } WHERE { ?s ?p ?o . ?p ?o } java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: org.openrdf.query.QueryEvaluationException: com.bigdata.rdf.internal.NotMaterializedException: TermId(37235U) at java.util.concurrent.FutureTask.report(Unknown Source) at java.util.concurrent.FutureTask.get(Unknown Source) at com.bigdata.rdf.sail.webapp.BigdataServlet.submitApiTask(BigdataServlet.java:294) at com.bigdata.rdf.sail.webapp.QueryServlet.doSparqlQuery(QueryServlet.java:678) at com.bigdata.rdf.sail.webapp.QueryServlet.doPost(QueryServlet.java:275) at com.bigdata.rdf.sail.webapp.RESTServlet.doPost(RESTServlet.java:269) at com.bigdata.rdf.sail.webapp.MultiTenancyServlet.doPost(MultiTenancyServlet.java:195) at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:865) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:535) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146) at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132) at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257) at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595) at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1340) at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473) at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564) at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1242) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144) at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:220) at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132) at org.eclipse.jetty.rewrite.handler.RewriteHandler.handle(RewriteHandler.java:335) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132) at org.eclipse.jetty.server.Server.handle(Server.java:503) at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:364) at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:260) at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:305) at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103) at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:118) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:765) at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:683) at java.lang.Thread.run(Unknown Source) Caused by: java.util.concurrent.ExecutionException: org.openrdf.query.QueryEvaluationException: com.bigdata.rdf.internal.NotMaterializedException: TermId(37235U) at java.util.concurrent.FutureTask.report(Unknown Source) at java.util.concurrent.FutureTask.get(Unknown Source) at com.bigdata.rdf.sail.webapp.QueryServlet$SparqlQueryTask.call(QueryServlet.java:889) at com.bigdata.rdf.sail.webapp.QueryServlet$SparqlQueryTask.call(QueryServlet.java:695) at com.bigdata.rdf.task.ApiTaskForIndexManager.call(ApiTaskForIndexManager.java:68) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) ... 1 more Caused by: org.openrdf.query.QueryEvaluationException: com.bigdata.rdf.internal.NotMaterializedException: TermId(37235U) at com.bigdata.rdf.sail.Bigdata2Sesame2BindingSetIterator.hasNext(Bigdata2Sesame2BindingSetIterator.java:188) at com.bigdata.rdf.sparql.ast.eval.ASTConstructIterator.hasNext(ASTConstructIterator.java:624) at info.aduna.iteration.IterationWrapper.hasNext(IterationWrapper.java:68) at org.openrdf.query.QueryResults.report(QueryResults.java:193) at org.openrdf.repository.sail.SailGraphQuery.evaluate(SailGraphQuery.java:114) at com.bigdata.rdf.sail.webapp.BigdataRDFContext$GraphQueryTask.doQuery(BigdataRDFContext.java:1777) at com.bigdata.rdf.sail.webapp.BigdataRDFContext$AbstractQueryTask.innerCall(BigdataRDFContext.java:1569) at com.bigdata.rdf.sail.webapp.BigdataRDFContext$AbstractQueryTask.call(BigdataRDFContext.java:1534) at com.bigdata.rdf.sail.webapp.BigdataRDFContext$AbstractQueryTask.call(BigdataRDFContext.java:747) ... 4 more Caused by: com.bigdata.rdf.internal.NotMaterializedException: TermId(37235U) at com.bigdata.rdf.internal.impl.AbstractIV.getValue(AbstractIV.java:993) at com.bigdata.rdf.sail.Bigdata2Sesame2BindingSetIterator.getBindingSet(Bigdata2Sesame2BindingSetIterator.java:305) at com.bigdata.rdf.sail.Bigdata2Sesame2BindingSetIterator.hasNext(Bigdata2Sesame2BindingSetIterator.java:140) ... 12 more

If I try to change that query to this second one:

CONSTRUCT { ?s <http://type> <http://obj> ; <http://label> "This is a test" ; <http://where> <http://not.void> . } WHERE { ?s ?p ?o . <http://test> ?p ?o }

it's working fine.

Anyway, I think that the first construct should be allowed, it seems to follow the SPARQL1.1 query grammar.

Edit: If there aren't triples these match with the Where patter of the construct, the construct run as well.

if for example before this construct you run this update:

INSERT DATA { <http://test> <p> <o>}

then the construct will go into error.

So if the where patter of the construct match some triple, Blazegraph returns that error.