Search code examples
graphdb

Graphdb restore from backup in curl


I'm writing a script to automatically setup a repository starting from a clean GraphDB running in a Docker container. I have a config.ttl file containing repository configuration, the namespace and a dump in a file init.nq I have successfully created the repository using the config.ttf and updated namespace but I cannot understand how to load the init.nq file.

This operation is extremely simple from web interface: Import -> RFD -> Upload, but I'm not able to understand how to perform it using Curl. I suppose that the correct API should be

post /repositories/{repositoryID}/statements 

but the dump is to huge to pass it as simple text (~44MB).


Solution

  • This should work:

    curl -X POST -H "Content-Type:application/n-quads" -T init.nq 'http://localhost:7200/repositories/test/statements'