Where is my RDF graph physically saved?

Hi everyone,

I am working with a Virtuoso Open Source 07.20.3217 version. I am storing a set of triples in a given graph via ISQL.


I would like to make some periodic backups of this data, in case we need to put this information in another server or whatever.

So, my question is: in which file does Virtuoso store this information? Is it a good practice to backup this file? Or does Virtuoso propose another approach?

Thanks in advance

The Virtuoso Database Server (i.e., Database Management System Application) stores in data in the Database File identified your Database Server Initialization File (i.e., INI file). By default, this is virtuoso.db, but it could be whatever you prefer.

Assuming the database file is virtuoso.db, you could make a backup of that file, if the Database Server Application has been shutdown cleanly. Otherwise, you should use the Backup Functionality to make a proper backup.

See: http://docs.openlinksw.com/virtuoso/backup_recovery/

@kidehen thanks for your help.

It is just as I thought. However, when I upload some triples via ISQL (as shown in the image from my previous post), the file that gets modified is virtuoso.trx instead of virtuoso.db.

Does this make sense? Should I also consider backing virtuoso.trx up? Or is it just how Virtuoso works with the transactions, etc?


@iesnaola: The virtuoso.trx file is the transaction log file current transaction are written to initially before being written to the virtuoso.db file when the next checkpoint is run and thus is expected and normal for a relational database. See details on the Virtuoso TransactionFile

You can manually run the Virtuoso checkpoint command to commit pending transaction to the virtuoso.db at anytime.

1 Like

Thanks @hwilliams for the information provided.

I am uploading my triples both via ISQL and via Java code (Jena). Is there any option to run this "checkpoint command" every time I upload a set of triples? I mean, is this "checkpoint command" available also via ISQL or via Jena?

@iesnaola: The checkpoint command can be run directly from the Virtuoso isql command line tool, or via any Virtuoso SQL interface (i.e., ODBC, JDBC, ADO.Net, etc.). You cannot run a checkpoint directly from Jena, which is an RDF abstraction framework, but you can make a JDBC connection in your Java code to run a checkpoint.