I'm creating a Stardog db using multipart/form-data POST to the HTTP API; this works well until I try to add initial data from a file in the same request. I get back a 500 error but after having looked through the docs, this forum, and using the debugger on
stardog.apiary-mock.com to capture my requests I am still clueless as to what I am doing wrong.
Minimal failing example using cURL:
[conradL@slithytove ~]$ curl -i --user admin:admin -H "Content-Type: multipart/form-data" -H "Accept: */*" -X POST -F 'root={"dbname":"testdb","options":{},"files":[{"name":"testfile.ttl"}]}' -F "testfile.ttl=@testfile.ttl;type=text/turtle" http://localhost:5820/admin/databases
HTTP/1.1 500 There was a fatal error on the server
Content-Length: 0
Server: Stardog/2.2.1/v4
testfile.ttl is a single triple in Turtle format (attached).
There are few things I'm uncertain of here and have tried changing with no joy:
1. Does it matter what I use for the form name for the file part of the request? Currently I'm just using the filename
2. Does it matter what Content-Type (as specified by the type param in -F) the file part of the request is?
3. Does it matter that I'm not specifying a context in the "files" JSON element? I've also tried "default" and "tag:stardog:api:context:default".
Any guidance appreciated; thanks.