You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Deepali Singhavi <de...@gmail.com> on 2021/02/15 13:09:05 UTC

Restoring Jena Backup over HTTP using file location as parameter

Hi,

I am trying to explore Jena Backup and restore options using fuseki
administrative http protocol

I am running below http command for taking the backup

*curl -i -X POST http://localhost:3030/$/backup/backuptest
<http://localhost:3030/$/backup/backuptest>*

And below command for restoring the backup

*curl -i -X PUT -H "Content-Type: application/n-quads" -d
@"run\backups\backuptest_2021-02-08_10-09-12.nq\backuptest_2021-02-08_10-09-12.nq"
http://localhost:3030/backuptest/ <http://localhost:3030/backuptest/>*

While it is working but I need to pass the file with Http put request for
backup is there any way to just pass the file location for restoring?

Note: I have already explored restoring backup using TDBloader2 but need to
stop the fuseki so not meeting our requirements.

Regards,
Deepali

Re: Restoring Jena Backup over HTTP using file location as parameter

Posted by Andy Seaborne <an...@apache.org>.
You don't need to use SPARQL.

Simply use "curl" or "wget" as a HTTP GET on the dataset URL (if you 
have service GSP enabled).

Use the 'Accept" header for the syntax you want.

(There's an operation in the RDFConnection API to do this as well).

     Andy



On 17/02/2021 11:47, Deepali Singhavi wrote:
> Hi Andy,
> 
> How we can write SPARQL query to fetch backup of entire dataset including
> all graphs and use the result to restore it?
> 
> Regards,
> Deepali
> 
> On Tue, 16 Feb 2021, 19:32 Andy Seaborne, <an...@apache.org> wrote:
> 
>>
>>
>> On 15/02/2021 13:09, Deepali Singhavi wrote:
>>> Hi,
>>>
>>> I am trying to explore Jena Backup and restore options using fuseki
>>> administrative http protocol
>>>
>>> I am running below http command for taking the backup
>>>
>>> *curl -i -X POST http://localhost:3030/$/backup/backuptest
>>> <http://localhost:3030/$/backup/backuptest>*
>>
>> That intentionally puts the backup on the server local disk so it is not
>> accessible from the outside. It is an admin operation with the
>> expectation that it is an admin task to reload the database if needed
>> (using tdbloader offline then swapping it into a server which is a
>> restart currently).
>>
>> If you want to do remote backup, simply send a SPARQL query to fetch the
>> database.
>>
>>> And below command for restoring the backup
>>>
>>> *curl -i -X PUT -H "Content-Type: application/n-quads" -d
>>>
>> @"run\backups\backuptest_2021-02-08_10-09-12.nq\backuptest_2021-02-08_10-09-12.nq"
>>> http://localhost:3030/backuptest/ <http://localhost:3030/backuptest/>*
>>>
>>> While it is working but I need to pass the file with Http put request for
>>> backup is there any way to just pass the file location for restoring?
>>>
>>> Note: I have already explored restoring backup using TDBloader2 but need
>> to
>>> stop the fuseki so not meeting our requirements.
>>>
>>> Regards,
>>> Deepali
>>>
>>
> 

Re: Restoring Jena Backup over HTTP using file location as parameter

Posted by Deepali Singhavi <de...@gmail.com>.
Hi Andy,

How we can write SPARQL query to fetch backup of entire dataset including
all graphs and use the result to restore it?

Regards,
Deepali

On Tue, 16 Feb 2021, 19:32 Andy Seaborne, <an...@apache.org> wrote:

>
>
> On 15/02/2021 13:09, Deepali Singhavi wrote:
> > Hi,
> >
> > I am trying to explore Jena Backup and restore options using fuseki
> > administrative http protocol
> >
> > I am running below http command for taking the backup
> >
> > *curl -i -X POST http://localhost:3030/$/backup/backuptest
> > <http://localhost:3030/$/backup/backuptest>*
>
> That intentionally puts the backup on the server local disk so it is not
> accessible from the outside. It is an admin operation with the
> expectation that it is an admin task to reload the database if needed
> (using tdbloader offline then swapping it into a server which is a
> restart currently).
>
> If you want to do remote backup, simply send a SPARQL query to fetch the
> database.
>
> > And below command for restoring the backup
> >
> > *curl -i -X PUT -H "Content-Type: application/n-quads" -d
> >
> @"run\backups\backuptest_2021-02-08_10-09-12.nq\backuptest_2021-02-08_10-09-12.nq"
> > http://localhost:3030/backuptest/ <http://localhost:3030/backuptest/>*
> >
> > While it is working but I need to pass the file with Http put request for
> > backup is there any way to just pass the file location for restoring?
> >
> > Note: I have already explored restoring backup using TDBloader2 but need
> to
> > stop the fuseki so not meeting our requirements.
> >
> > Regards,
> > Deepali
> >
>

Re: Restoring Jena Backup over HTTP using file location as parameter

Posted by Andy Seaborne <an...@apache.org>.

On 15/02/2021 13:09, Deepali Singhavi wrote:
> Hi,
> 
> I am trying to explore Jena Backup and restore options using fuseki
> administrative http protocol
> 
> I am running below http command for taking the backup
> 
> *curl -i -X POST http://localhost:3030/$/backup/backuptest
> <http://localhost:3030/$/backup/backuptest>*

That intentionally puts the backup on the server local disk so it is not 
accessible from the outside. It is an admin operation with the 
expectation that it is an admin task to reload the database if needed 
(using tdbloader offline then swapping it into a server which is a 
restart currently).

If you want to do remote backup, simply send a SPARQL query to fetch the 
database.

> And below command for restoring the backup
> 
> *curl -i -X PUT -H "Content-Type: application/n-quads" -d
> @"run\backups\backuptest_2021-02-08_10-09-12.nq\backuptest_2021-02-08_10-09-12.nq"
> http://localhost:3030/backuptest/ <http://localhost:3030/backuptest/>*
> 
> While it is working but I need to pass the file with Http put request for
> backup is there any way to just pass the file location for restoring?
> 
> Note: I have already explored restoring backup using TDBloader2 but need to
> stop the fuseki so not meeting our requirements.
> 
> Regards,
> Deepali
>