The entire contents of Callimachus folders, including all BLOB and RDF resources, may be exported into a Callimachus Archive (CAR) file. A CAR file is a ZIP version 3 formatted file that contains Callimachus-specific metadata. Exporting a CAR file from a folder recursively creates an archive of that folder's contents (not the folder itself), including any subfolders.

Exportation of CAR files may be performed at runtime and may be used for "hot" backup of the contents of a Callimachus server. Please also note that exportation of large amounts of RDF content will increase server load and may best be scheduled during quiet usage periods.

Export

Performing an HTTP OPTIONS on a folder URL returns a link: header with rel=”...#archive”, a content type and the folder's Archive URL to be used to get an export of the folder's contents. Performing a GET on the Archive URL using an Accept: header as noted in the type attribute (generally application/zip) will download the folder's contents as a ZIP version 3 file containing Callimachus-specific content. This is called a Callimachus Archive (CAR) file.

To get an export of a folder called "/exportme/":

GET http://example.com:8080/exportme/#rel=..archive HTTP/1.1
Accept: application/zip
Authorization: Digest username="john", realm="http://example.com:8080/", ...

The equivalent curl command is:

curl --digest --user john -H "Accept: application/zip" "http://example.com:8080/exportme/#rel=..archive" > exportme.car

Normal HTTP response codes are used to indicate success or failure of the request:

HTTP/1.1 200 OK
Content-Disposition:  attachment;filename="test-example.com.car"
Content-Type:  application/zip
Server:  Callimachus Server/Callimachus 0.15

<Binary ZIP file content here>

NB: CAR files contain a folder's contents, including any subfolders and their contents. CAR files do not contain a top-level folder; a new folder must be first created when importing CAR files.

Import

CAR files do not contain a top-level folder and must thus be imported into an existing folder. Create a folder before importing a CAR into it. It is not recommended to import CAR files into the top-level folder due to the presence of folders and resources necessary to the operation of Callimachus.

Performing an HTTP OPTIONS on a folder URL returns a link: header with rel=”...#archive”, a content type and the folder's Archive URL to be used to import the folder's contents. Performing an HTTP PUT with a Content-Type: header of application/zip and a body of a CAR file will replace the contents of a folder.

To replace the contents of a folder called "/importme/" with the CAR file exportme.car, first make the folder "/importme/" and then:

PUT http://example.com:8080/importme/#rel=..archive HTTP/1.1
Content-Type: application/zip
Authorization: Digest username="john", realm="http://example.com:8080/", ...

Normal HTTP response codes are used to indicate success or failure of the request:

HTTP/1.1 204 No Content
Server: Callimachus Server/Callimachus 0.15
...

Delete

Performing an HTTP OPTIONS on a folder URL returns a link: header with rel=”...#archive”, a content type and the folder's Archive URL to be used to delete the folder's contents. Performing an HTTP DELETE will delete the entire contents of a folder recursively, but it will not delete the folder itself.

To delete the contents of a folder called /deleteme/:

DELETE http://example.com:8080/deleteme/#rel=..archive
Authorization: Digest username="john", realm="http://example.com:8080/", ...

Normal HTTP response codes are used to indicate success or failure of the request:

HTTP/1.1 204 No Content
Server: Callimachus Server/Callimachus 1.0
...