full text indexing

Help
PaulZ
2012-04-02
2014-02-19
  • PaulZ
    PaulZ
    2012-04-02

    BigData 1.2

    Using the NanoSparqlServer.

    Having set:
    com.bigdata.rdf.store.AbstractTripleStore.textIndex=true
    in RWStore.properties before starting the server.

    Following query returns the expected results:
    SELECT *
    WHERE {?s ?p ?o.
    FILTER (?o = "John")}

    However using the magic predicate
    SELECT *
    WHERE {?s ?p ?o.
    ?o bd:search "John".}
    doesn't return results.

    How can I check if the text indexing is working?

    If I use
    select *
    where {
    ?s ?p ?o .
    FILTER (regex(?o,"John","i"))
    }

    I get following error message:
    java.util.concurrent.ExecutionException: org.openrdf.query.QueryEvaluationException: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.Exception: task=ChunkTask{query=58368b05-5e43-4deb-acef-3b79b7ebae98,bopId=3,partitionId=-1,sinkId=6,altSinkId=null}, cause=java.util.concurrent.ExecutionException: java.lang.RuntimeException: com.bigdata.rdf.internal.NotMaterializedException: Vocab(62)
    at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222)
    at java.util.concurrent.FutureTask.get(FutureTask.java:83)
    at com.bigdata.rdf.sail.webapp.QueryServlet.doQuery(QueryServlet.java:603)
    at com.bigdata.rdf.sail.webapp.QueryServlet.doPost(QueryServlet.java:118)
    at com.bigdata.rdf.sail.webapp.RESTServlet.doPost(RESTServlet.java:133)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:399)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:317)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:204)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:182)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:311)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:680)
    Caused by: org.openrdf.query.QueryEvaluationException: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.Exception: task=ChunkTask{query=58368b05-5e43-4deb-acef-3b79b7ebae98,bopId=3,partitionId=-1,sinkId=6,altSinkId=null}, cause=java.util.concurrent.ExecutionException: java.lang.RuntimeException: com.bigdata.rdf.internal.NotMaterializedException: Vocab(62)
    at com.bigdata.rdf.sail.Bigdata2Sesame2BindingSetIterator.hasNext(Bigdata2Sesame2BindingSetIterator.java:119)
    at org.openrdf.query.impl.TupleQueryResultImpl.hasNext(TupleQueryResultImpl.java:90)
    at org.openrdf.query.QueryResultUtil.report(QueryResultUtil.java:52)
    at org.openrdf.repository.sail.SailTupleQuery.evaluate(SailTupleQuery.java:63)
    at com.bigdata.rdf.sail.webapp.BigdataRDFContext$TupleQueryTask.doQuery(BigdataRDFContext.java:917)
    at com.bigdata.rdf.sail.webapp.BigdataRDFContext$AbstractQueryTask.call(BigdataRDFContext.java:809)
    at com.bigdata.rdf.sail.webapp.BigdataRDFContext$AbstractQueryTask.call(BigdataRDFContext.java:328)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    … 3 more
    Caused by: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.Exception: task=ChunkTask{query=58368b05-5e43-4deb-acef-3b79b7ebae98,bopId=3,partitionId=-1,sinkId=6,altSinkId=null}, cause=java.util.concurrent.ExecutionException: java.lang.RuntimeException: com.bigdata.rdf.internal.NotMaterializedException: Vocab(62)
    at com.bigdata.relation.accesspath.BlockingBuffer$BlockingIterator.checkFuture(BlockingBuffer.java:1481)
    at com.bigdata.relation.accesspath.BlockingBuffer$BlockingIterator._hasNext(BlockingBuffer.java:1658)
    at com.bigdata.relation.accesspath.BlockingBuffer$BlockingIterator.hasNext(BlockingBuffer.java:1521)
    at com.bigdata.striterator.AbstractChunkedResolverator._hasNext(AbstractChunkedResolverator.java:352)
    at com.bigdata.striterator.AbstractChunkedResolverator.hasNext(AbstractChunkedResolverator.java:328)
    at com.bigdata.rdf.sail.Bigdata2Sesame2BindingSetIterator.hasNext(Bigdata2Sesame2BindingSetIterator.java:100)
    … 11 more
    Caused by: java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.Exception: task=ChunkTask{query=58368b05-5e43-4deb-acef-3b79b7ebae98,bopId=3,partitionId=-1,sinkId=6,altSinkId=null}, cause=java.util.concurrent.ExecutionException: java.lang.RuntimeException: com.bigdata.rdf.internal.NotMaterializedException: Vocab(62)
    at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222)
    at java.util.concurrent.FutureTask.get(FutureTask.java:83)
    at com.bigdata.relation.accesspath.BlockingBuffer$BlockingIterator.checkFuture(BlockingBuffer.java:1434)
    … 16 more
    Caused by: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.Exception: task=ChunkTask{query=58368b05-5e43-4deb-acef-3b79b7ebae98,bopId=3,partitionId=-1,sinkId=6,altSinkId=null}, cause=java.util.concurrent.ExecutionException: java.lang.RuntimeException: com.bigdata.rdf.internal.NotMaterializedException: Vocab(62)
    at com.bigdata.rdf.sail.RunningQueryCloseableIterator.checkFuture(RunningQueryCloseableIterator.java:58)
    at com.bigdata.rdf.sail.RunningQueryCloseableIterator.close(RunningQueryCloseableIterator.java:72)
    at com.bigdata.rdf.sail.RunningQueryCloseableIterator.hasNext(RunningQueryCloseableIterator.java:81)
    at com.bigdata.striterator.ChunkedWrappedIterator.hasNext(ChunkedWrappedIterator.java:193)
    at com.bigdata.striterator.AbstractChunkedResolverator$ChunkConsumerTask.call(AbstractChunkedResolverator.java:218)
    at com.bigdata.striterator.AbstractChunkedResolverator$ChunkConsumerTask.call(AbstractChunkedResolverator.java:194)
    … 5 more
    Caused by: java.util.concurrent.ExecutionException: java.lang.Exception: task=ChunkTask{query=58368b05-5e43-4deb-acef-3b79b7ebae98,bopId=3,partitionId=-1,sinkId=6,altSinkId=null}, cause=java.util.concurrent.ExecutionException: java.lang.RuntimeException: com.bigdata.rdf.internal.NotMaterializedException: Vocab(62)
    at com.bigdata.util.concurrent.Haltable.get(Haltable.java:251)
    at com.bigdata.bop.engine.AbstractRunningQuery.get(AbstractRunningQuery.java:1401)
    at com.bigdata.bop.engine.AbstractRunningQuery.get(AbstractRunningQuery.java:100)
    at com.bigdata.rdf.sail.RunningQueryCloseableIterator.checkFuture(RunningQueryCloseableIterator.java:45)
    … 10 more
    Caused by: java.lang.Exception: task=ChunkTask{query=58368b05-5e43-4deb-acef-3b79b7ebae98,bopId=3,partitionId=-1,sinkId=6,altSinkId=null}, cause=java.util.concurrent.ExecutionException: java.lang.RuntimeException: com.bigdata.rdf.internal.NotMaterializedException: Vocab(62)
    at com.bigdata.bop.engine.ChunkedRunningQuery$ChunkTask.call(ChunkedRunningQuery.java:1291)
    at com.bigdata.bop.engine.ChunkedRunningQuery$ChunkTaskWrapper.run(ChunkedRunningQuery.java:828)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at com.bigdata.concurrent.FutureTaskMon.run(FutureTaskMon.java:63)
    at com.bigdata.bop.engine.ChunkedRunningQuery$ChunkFutureTask.run(ChunkedRunningQuery.java:729)
    … 3 more
    Caused by: java.util.concurrent.ExecutionException: java.lang.RuntimeException: com.bigdata.rdf.internal.NotMaterializedException: Vocab(62)
    at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222)
    at java.util.concurrent.FutureTask.get(FutureTask.java:83)
    at com.bigdata.bop.engine.ChunkedRunningQuery$ChunkTask.call(ChunkedRunningQuery.java:1271)
    … 9 more
    Caused by: java.lang.RuntimeException: com.bigdata.rdf.internal.NotMaterializedException: Vocab(62)
    at com.bigdata.rdf.internal.constraints.SPARQLConstraint.accept(SPARQLConstraint.java:128)
    at com.bigdata.bop.bset.ConditionalRoutingOp$ConditionalRouteTask.call(ConditionalRoutingOp.java:173)
    at com.bigdata.bop.bset.ConditionalRoutingOp$ConditionalRouteTask.call(ConditionalRoutingOp.java:119)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at com.bigdata.bop.engine.ChunkedRunningQuery$ChunkTask.call(ChunkedRunningQuery.java:1270)
    … 9 more
    Caused by: com.bigdata.rdf.internal.NotMaterializedException: Vocab(62)
    at com.bigdata.rdf.internal.impl.AbstractIV.getValue(AbstractIV.java:887)
    at com.bigdata.rdf.internal.constraints.RegexBOp.accept(RegexBOp.java:164)
    at com.bigdata.rdf.internal.constraints.XSDBooleanIVValueExpression.get(XSDBooleanIVValueExpression.java:99)
    at com.bigdata.rdf.internal.constraints.XSDBooleanIVValueExpression.get(XSDBooleanIVValueExpression.java:40)
    at com.bigdata.rdf.internal.constraints.SPARQLConstraint.accept(SPARQLConstraint.java:111)
    … 14 more

     
  • Bryan Thompson
    Bryan Thompson
    2012-04-02

    The REGEX thing is a bug.  I've filed an issue for it .

    Assuming that you enabled search before starting the WAR for the first time (since the "textIndex" property is "baked" into the triple store instance), then the problem is that you are not declaring the namespace for the magic search predicates properly.  It is defaulting to a different namespace for the bd: prefix….

    Try adding this:
    <code>
    PREFIX bd: <http://www.bigdata.com/rdf/search#>
    </code>

    Thanks,
    Bryan
    https://sourceforge.net/apps/trac/bigdata/ticket/539

     
  • PaulZ
    PaulZ
    2012-04-03

    Thanks,
    I couldn't find the PREFIX declaration in the docs.
    I would have expected an error saying so, but the results were empty; so I thought the prefix really was magic :-).

     
  • PaulZ
    PaulZ
    2012-04-03

    There is a typo in the blog http://www.bigdata.com/bigdata/blog/?p=330

    select ?s, ?p, o <- lacking question mark

     
  • Bryan Thompson
    Bryan Thompson
    2012-04-03

    Thanks for pointing that out. It's fixed now.  The same error was present on the wiki page.
    Bryan