Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2 wildcard fulltext search error #906

Closed
gfoo opened this issue Jun 22, 2018 · 5 comments · Fixed by #909
Closed

v2 wildcard fulltext search error #906

gfoo opened this issue Jun 22, 2018 · 5 comments · Fixed by #909
Assignees
Labels
API/V2 bug something isn't working

Comments

@gfoo
Copy link

gfoo commented Jun 22, 2018

I get this error with this request http://localhost:3333/v2/search/*i*:

{
error: "org.knora.webapi.InconsistentTriplestoreDataException: Expected http://www.w3.org/2000/01/rdf-schema#label in assertions for a value object of type list value."
}

It works with:

  • two letters : http://localhost:3333/v2/search/*ii*
  • v1 : http://localhost:3333/v2/search/*i*?searchtype=fulltext

Update doc ? not found any mentions of:

  • the wildcard for full text search
  • the 3 characters required for the search value
@gfoo gfoo added bug something isn't working API/V2 labels Jun 22, 2018
@tobiasschweizer
Copy link
Contributor

@gfoo thanks for reporting this, I will try to reproduce it on Monday.

Thanks for pointing out the missing documentation!

@tobiasschweizer tobiasschweizer self-assigned this Jun 22, 2018
@gfoo
Copy link
Author

gfoo commented Jun 22, 2018

can help:

webapi [2018-06-22 14:18:18,146] ERROR - KnoraService(akka://webapi) - Unable to run route /v2/search/*a*
webapi org.knora.webapi.InconsistentTriplestoreDataException: Expected http://www.w3.org/2000/01/rdf-schema#label in assertions for a value object of type list value.
webapi 	at org.knora.webapi.util.ConstructResponseUtilV2$.createValueContentV2FromValueRdfData(ConstructResponseUtilV2.scala:564)
webapi 	at org.knora.webapi.util.ConstructResponseUtilV2$.$anonfun$constructReadResourceV2$3(ConstructResponseUtilV2.scala:686)
webapi 	at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:234)
webapi 	at scala.collection.Iterator.foreach(Iterator.scala:929)
webapi 	at scala.collection.Iterator.foreach$(Iterator.scala:929)
webapi 	at scala.collection.AbstractIterator.foreach(Iterator.scala:1417)
webapi 	at scala.collection.IterableLike.foreach(IterableLike.scala:71)
webapi 	at scala.collection.IterableLike.foreach$(IterableLike.scala:70)
webapi 	at scala.collection.AbstractIterable.foreach(Iterable.scala:54)
webapi 	at scala.collection.TraversableLike.map(TraversableLike.scala:234)
webapi 	at scala.collection.TraversableLike.map$(TraversableLike.scala:227)
webapi 	at scala.collection.AbstractTraversable.map(Traversable.scala:104)
webapi 	at org.knora.webapi.util.ConstructResponseUtilV2$.$anonfun$constructReadResourceV2$1(ConstructResponseUtilV2.scala:684)
webapi 	at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:234)
webapi 	at scala.collection.immutable.HashMap$HashMap1.foreach(HashMap.scala:231)
webapi 	at scala.collection.immutable.HashMap$HashTrieMap.foreach(HashMap.scala:462)
webapi 	at scala.collection.TraversableLike.map(TraversableLike.scala:234)
webapi 	at scala.collection.TraversableLike.map$(TraversableLike.scala:227)
webapi 	at scala.collection.AbstractTraversable.map(Traversable.scala:104)
webapi 	at org.knora.webapi.util.ConstructResponseUtilV2$.constructReadResourceV2(ConstructResponseUtilV2.scala:673)
webapi 	at org.knora.webapi.util.ConstructResponseUtilV2$.$anonfun$createSearchResponse$1(ConstructResponseUtilV2.scala:737)
webapi 	at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:234)
webapi 	at scala.collection.immutable.List.foreach(List.scala:389)
webapi 	at scala.collection.TraversableLike.map(TraversableLike.scala:234)
webapi 	at scala.collection.TraversableLike.map$(TraversableLike.scala:227)
webapi 	at scala.collection.immutable.List.map(List.scala:295)
webapi 	at org.knora.webapi.util.ConstructResponseUtilV2$.createSearchResponse(ConstructResponseUtilV2.scala:728)
webapi 	at org.knora.webapi.responders.v2.SearchResponderV2.$anonfun$fulltextSearchV2$23(SearchResponderV2.scala:1652)
webapi 	at scala.util.Success.$anonfun$map$1(Try.scala:251)
webapi 	at scala.util.Success.map(Try.scala:209)
webapi 	at scala.concurrent.Future.$anonfun$map$1(Future.scala:289)
webapi 	at scala.concurrent.impl.Promise.liftedTree1$1(Promise.scala:29)
webapi 	at scala.concurrent.impl.Promise.$anonfun$transform$1(Promise.scala:29)
webapi 	at scala.concurrent.impl.CallbackRunnable.run_aroundBody0(Promise.scala:60)
webapi 	at scala.concurrent.impl.CallbackRunnable$AjcClosure1.run(Promise.scala:1)
webapi 	at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:149)
webapi 	at kamon.scala.instrumentation.FutureInstrumentation.$anonfun$aroundExecution$1(FutureInstrumentation.scala:46)
webapi 	at kamon.Kamon$.withContext(Kamon.scala:120)
webapi 	at kamon.scala.instrumentation.FutureInstrumentation.aroundExecution(FutureInstrumentation.scala:46)
webapi 	at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:59)
webapi 	at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:55)
webapi 	at akka.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:91)
webapi 	at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
webapi 	at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:81)
webapi 	at akka.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:91)
webapi 	at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:40)
webapi 	at kamon.executors.Executors$InstrumentedExecutorService$$anon$7.run(Executors.scala:270)
webapi 	at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(ForkJoinExecutorConfigurator.scala:43)
webapi 	at akka.dispatch.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
webapi 	at akka.dispatch.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
webapi 	at akka.dispatch.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
webapi 	at akka.dispatch.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)

@tobiasschweizer
Copy link
Contributor

@gfoo The problem was caused by a change I introduced for the v2 full resource request and Gravsearch queries, but not for v2 fulltext search: when a list value is found, also the label of the list node pointed to is returned. We will get rid of this soon since there is a v2 route for querying lists now. Given a list node's Iri, the client can get the whole list.

I excluded list values from v2 fulltext search for now. However, it would make sense to search for comments on list values. But it does not make sense to search for their valueHasString since it contains the Iri of the list node pointed to (so the list node's label is not stored redundantly).

In short: what you found with *i* was an Iri of a list node:

 ValueRdfData(
   listNode = Map(), 
   valueObjectIri = "http://rdfh.ch/0001/H6gBWUuJSuuO-CilHV8kQw/values/XAhEeE3kSVqM4JPGdLt4Ew", 
   incomingLink = false, 
   standoff = Map(), 
   valueObjectClass = "http://www.knora.org/ontology/knora-base#ListValue", 
   assertions = Map(
   "http://www.knora.org/ontology/knora-base#valueHasString" -> "http://rdfh.ch/lists/0001/treeList01", 
   "http://www.knora.org/ontology/knora-base#attachedToUser" -> "http://rdfh.ch/users/BhkfBc3hTeS_IDo-JgXRbQ", 
   "http://www.knora.org/ontology/knora-base#valueHasOrder" -> "0", 
   "http://www.knora.org/ontology/knora-base#valueCreationDate" -> "2018-05-28T15:52:03.897Z", 
   "http://www.knora.org/ontology/knora-base#valueHasListNode" -> "http://rdfh.ch/lists/0001/treeList01", 
   "http://www.knora.org/ontology/knora-base#isDeleted" -> "false", 
   "http://www.knora.org/ontology/knora-base#hasPermissions" -> "CR knora-base:Creator|M knora-base:ProjectMember|V knora-base:KnownUser|RV knora-base:UnknownUser", 
   "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" -> "http://www.knora.org/ontology/knora-base#ListValue"
   ), 
   nestedResource = None
 )

@gfoo
Copy link
Author

gfoo commented Jun 25, 2018

ok, thx, bug not important for me, fix when you have time. I found the bug by chance anyway, I just wanted printout all my resources to debug other stuffs ! (*** doesn't work either, probably same bug)

@tobiasschweizer
Copy link
Contributor

I have already made a PR for it: #909 It should be ready to review later this morning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API/V2 bug something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants