From: Andy Seaborne
Sent: martes, 29 de agosto de 2017 19:31
To: users@jena.apache.org
Subject: Re: Backup TDB and named model



On 29/08/17 15:45, aj...@apache.org wrote:
> tdbdump (along with all of the TDB shell utilities) is available in the 
> Jena full distribution:
> 
> https://jena.apache.org/download/index.cgi
> 
> 
> ajs6f
> 
> George News wrote on 8/29/17 2:30 AM:
>> 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());

A SPARQL UPDATE of using "MOVE" is neater.

For TDB, there is little choice but to do some kind of copy to rename. 
It is a change to the quads for the graph with no indirection to flip 
the name in the storage.

     Andy

Thanks. Can you provide an example please? When you say it’s neater, isnit also 
quicker and more robust?

Reply via email to