Search code examples
httplucenerdf4j

rdf4j lucene over http


I'm having trouble using the built-in lucene index via RDF4J over HTTP. I've followed the following steps:

  1. Using rdf4j-workbench, I created a repository using the type Native Java Store with RDFS+SPIN+Lucene
  2. On the client, I use: repo = new HTTPRepository( <server>, <repo> ); repo.initialize();
  3. I loaded the repository as I normally would. I see on the server there is a directory called server/repositories/<repo>/index which appears to contain a lucene index.
  4. I run the query following the documentation here: http://docs.rdf4j.org/programming/#_full_text_indexing_with_the_lucene_sail.
  5. No hits are returned.
  6. I move the repository and index to the local machine, and use a LuceneSail to create the repository connection.
  7. Rerun the same query, and I get hits.

How do I reproduce the local results from the server over HTTP?


Solution

  • The problem is not in the HTTP connection, but in the fact that you're using the RDFS+SPIN+Lucene configuration when working on the server. I've just ran a few tests and this combination gives unexpected results even when querying it locally instead of over HTTP.

    The short of it is that there appears to be a bug in that specific sail configuration (the culprit, specifically, seems to be the SPIN reasoner). Unless you specifically need that configuration, I suggest that you can work around the issue by just using a "Native store with Lucene Support" for now. I will update this answer as soon as I know more about the specifics of the bug.