title: Apache Jena full-text search (with external content)
body: <p>I would like to configure something like this:</p>
  
  <ol>
  <li>RDF dataset of metadata about books;</li>
  <li>Books placed separately like XHTML files, paragraphs with unique IDs;</li>
  <li>Every book’s metadata includes something like <code>dc:source</code> link to the file (absolute? like a proper URI, what about scaling?);</li>
  </ol>
  
  <hr>
  
  <p>I know this could be pretty trivial but I can’t grasp that properly. At the beginning I am trying to index just pure TXT tiny files, every linked from <code>dc:source</code> in the metadata file. As I understand, this should be enough for indexing everything included. I am trying to do it like the guy in <a href="https://stackoverflow.com/questions/30447536/fuseki-indexed-lucene-text-search-returns-no-results">this post</a> here. Unlike him, I want to index RDF dataset <strong>as well as</strong> external files. Especially these two commands log no errors (in contrary, it logs there are 57 triples):</p>
  
  <pre><code>java -cp /home/honza/.apache-jena-fuseki-2.3.0/fuseki-server.jar tdb.tdbloader --tdb=run/configuration/service2.ttl testDir/test_dataset.ttl
  
  INFO  -- Start triples data phase
  INFO  ** Load into triples table with existing data
  INFO  -- Start quads data phase
  INFO  ** Load empty quads table
  INFO  Load: testDir/test_dataset.ttl -- 2015/11/13 12:46:22 CET
  INFO  -- Finish triples data phase
  INFO  ** Data: 57 triples loaded in 0,29 seconds [Rate: 193,22 per second]
  INFO  -- Finish quads data phase
  INFO  -- Start triples index phase
  INFO  -- Finish triples index phase
  INFO  -- Finish triples load
  INFO  ** Completed: 57 triples loaded in 0,33 seconds [Rate: 172,21 per second]
  INFO  -- Finish quads load
  </code></pre>
  
  <p>and</p>
  
  <pre><code>java -cp /home/honza/.apache-jena-fuseki-2.3.0/fuseki-server.jar jena.textindexer --desc=run/configuration/service2.ttl
  
  WARN  Values stored but langField not set. Returned values will not have language tag or datatype.
  </code></pre>
  
  <p>After that, server runs properly, I see the graph but it includes no data.</p>
  
  <p>My config for this service is (I don’t know whether it is right to have service and DB config in one file, for me it works better at the moment, dividing throws some errors):</p>
  
  <pre><code>@prefix fuseki:  &lt;http://jena.apache.org/fuseki#&gt; .
  @prefix rdf:     &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#&gt; .
  @prefix rdfs:    &lt;http://www.w3.org/2000/01/rdf-schema#&gt; .
  @prefix tdb:     &lt;http://jena.hpl.hp.com/2008/tdb#&gt; .
  @prefix ja:      &lt;http://jena.hpl.hp.com/2005/11/Assembler#&gt; .
  @prefix text:    &lt;http://jena.apache.org/text#&gt; .
  @prefix :        &lt;#&gt; .
  
  [] rdf:type fuseki:Server 
  .
  
  &lt;#service2&gt; rdf:type fuseki:Service ;
    rdfs:label                        "TDB/text service" ;
    fuseki:name                       "test" ;       # http://host:port/ds
    fuseki:serviceQuery               "sparql" ;   # SPARQL query service
    fuseki:serviceQuery               "query" ;    # SPARQL query service (alt name)
    fuseki:serviceUpdate              "update" ;   # SPARQL update service
    fuseki:serviceUpload              "upload" ;   # Non-SPARQL upload service
    fuseki:serviceReadWriteGraphStore "data" ;     # SPARQL Graph store protocol (read and write)
    # A separate read-only graph store endpoint:
    fuseki:serviceReadGraphStore      "get" ;      # SPARQL Graph store protocol (read only)
    fuseki:dataset                    :text_dataset 
  .
  
  [] ja:loadClass   "org.apache.jena.tdb.TDB" .
  tdb:DatasetTDB  rdfs:subClassOf  ja:RDFDataset .
  tdb:GraphTDB    rdfs:subClassOf  ja:Model .
  
  [] ja:loadClass "org.apache.jena.query.text.TextQuery" .
  
  text:TextIndexLucene rdfs:subClassOf  text:TextIndex .
  :text_dataset rdf:type text:TextDataset ;
    text:dataset &lt;#test&gt; ;
    text:index &lt;#indexLucene&gt; .
  </code></pre>