Hi,

I have a named graph that is becoming very big, and therefore searches on it 
are quite slow. I'm planning on make a backup from time to time and reset the 
data in the original.

The code that I'm currently using is the one below, which summarizing consists 
on creating a new graph based on the original one, delete the original and 
create it from scratch.

public void reset() {
  dataset.begin(ReadWrite.WRITE);
  try {
    LocalDateTime date = LocalDateTime.now();
    DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMddHHmm");
    String dateString = date.format(formatter);
    String backupModelName = modelName + "-" + dateString;
    dataset.addNamedModel(backupModelName, getModel());
    dataset.removeNamedModel(modelName);
    dataset.addNamedModel(modelName,
                          FiestaIoTOntModel.getInstance());
    dataset.commit();
  } finally {
    dataset.end();
  }
}


Is there any easier way to do this? 

Besides, I want to also get the graph model as a text file or backup file to be 
stored in another machine. I have read about `tdbdump` utility. Where can I 
find it? I'm only using JENA Java libraries.

Thanks in advance.

Reply via email to