You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@jena.apache.org by GitBox <gi...@apache.org> on 2022/07/03 05:13:12 UTC

[GitHub] [jena] natebowang commented on issue #1421: tdb2:location doesn't work

natebowang commented on issue #1421:
URL: https://github.com/apache/jena/issues/1421#issuecomment-1173013459

   Thanks for your quick reply. 
   
   What I want to do is to load an existing TDB2 database. 
   
   Here is the `assembler.ttl`: 
   ```ttl
   # Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
   
   PREFIX :        <#>
   PREFIX fuseki:  <http://jena.apache.org/fuseki#>
   PREFIX rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
   PREFIX rdfs:    <http://www.w3.org/2000/01/rdf-schema#>
   PREFIX tdb2:    <http://jena.apache.org/2016/tdb#>
   PREFIX ja:      <http://jena.hpl.hp.com/2005/11/Assembler#>
   
   ## ---------------------------------------------------------------
   ## Updatable TDB2 dataset with all services enabled.
   
   <#service_tdb_all> rdf:type fuseki:Service ;
       rdfs:label                         "TDB2 ds" ;
       fuseki:name                        "ds" ;
       fuseki:serviceQuery                "" ;
       fuseki:serviceQuery                "sparql" ;
       fuseki:serviceQuery                "query" ;
       fuseki:serviceUpdate               "" ;
       fuseki:serviceUpdate               "update" ;
       fuseki:serviceReadWriteGraphStore  "data" ;     
       fuseki:serviceReadGraphStore       "get" ;
       fuseki:dataset                     <#tdb_dataset_readwrite> ;
       
       .
   
   <#tdb_dataset_readwrite> rdf:type      tdb2:DatasetTDB2 ;
       tdb2:location  "/wbfile/draft/locTest/expectedDbDir" ;
       ##tdb2:unionDefaultGraph true ;
       .
   ```
   
   Here is the test: 
   ```bash
   [16:28 0 wangbo@msg8:locTest] tree -L 2
   .
   ├── assembler.ttl
   ├── expectedDbDir
   │   ├── Data-0001
   │   └── tdb.lock
   └── logs
   
   2 directories, 3 files
   
   [16:28 0 wangbo@msg8:locTest] # Load the TDB2 database with --loc argument
   [16:28 0 wangbo@msg8:locTest] fuseki-server --loc=./expectedDbDir/ /ds  > ./logs & 
   [1] 2288593
   [17:00 1 wangbo@msg8:locTest] # There is data in the db
   [17:00 1 wangbo@msg8:locTest] s-query --service=http://localhost:3030/ds "SELECT count(?s) { ?s ?p ?o . }" | jq
   {
     "head": {
       "vars": [
         ".1"
       ]
     },
     "results": {
       "bindings": [
         {
           ".1": {
             "type": "literal",
             "datatype": "http://www.w3.org/2001/XMLSchema#integer",
             "value": "36"
           }
         }
       ]
     }
   }
   [17:00 1 wangbo@msg8:locTest] kill %1
   
   [17:00 1 wangbo@msg8:locTest] # Load the TDB2 database with assembler
   [17:00 1 wangbo@msg8:locTest] fuseki-server --desc=assembler.ttl /ds > ./logs &
   [1] 2288951
   [17:00 1 wangbo@msg8:locTest] # No data in the db
   [17:01 1 wangbo@msg8:locTest] s-query --service=http://localhost:3030/ds "SELECT count(?s) { ?s ?p ?o . }" | jq
   404 Not found: http://localhost:3030/ds?query=SELECT+count%28%3Fs%29+%7B+%3Fs+%3Fp+%3Fo+.+%7D
   Failed to connect: localhost:3030: exit
   parse error: Invalid numeric literal at line 1, column 6
   ```
   
   Is the `assembler.ttl` correct? 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@jena.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@jena.apache.org
For additional commands, e-mail: issues-help@jena.apache.org