简体   繁体   中英

How to check if Jena TDB is created and the triple store is working

I have been working recently with Jena TDB. My goal is to store an RDF file which is a representation of an RDF graphs. Everything works fine with my code and i am able to query what i have stored as well.But I am still not sure if my data was completely stored or not! I know that Jena TDB index the content of the file and that there are several indexes built for one file which will be stored in a specified folder. But how do I check if the database is created and all the RDF files that i will provide to TDB will be stored with the previous ones? is there any way to do so online maybe or in java? and is my code enough to work with big amount of data or not ?

public static void main(String[] args) {

        String directory = "/*location*/ ";
        Dataset dataset = TDBFactory.createDataset(directory);

        Model tdb = dataset.getNamedModel("RDFData");


        // read the input file
        String source = "/*location*/rdfstorage.rdf";
        FileManager.get().readModel( tdb, source);
tdb.close();
        dataset.close();
}

Check the location and see if the files have been updated.

It is better to use a transaction. Your code is OK but if it is interrupted, the store may be corrupted.

https://jena.apache.org/documentation/tdb/tdb_transactions.html

If the source is large, use the bulkloader from the command line.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM