Jena TDB to store and query using API

前端 未结 2 1737
灰色年华
灰色年华 2021-02-09 18:28

I am new to both Jena-TDB and SPARQL, so it might be a silly question. I am using tdb-0.9.0, on Windows XP.

I am creating the TDB model for my trail_1.rdf f

2条回答
  •  不思量自难忘°
    2021-02-09 19:12

    The problem in your part 1 code is, I think, you are not committing the data .

    Try with this version of your part 1 code:

       String directory = "D:\\Project\\Store_DB\\data1\\tdb";
       Dataset dataset = TDBFactory.createDataset(directory);
    
       Model tdb = dataset.getDefaultModel();
    
       // read the input file
       String source = "D:\\Project\\Store_DB\\tmp\\trail_1.rdf";
       FileManager.get().readModel( tdb, source);
    
       dataset.commit();//INCLUDE THIS STAMEMENT
    
       tdb.close();
       dataset.close();
    

    and then try with your part 3 code :) ....

提交回复
热议问题