On 14/11/17 17:13, Kieron Taylor wrote:
Hi everyone,

Up to now I've relied on the ruby scripts shipping with Fuseki to load data 
onto a server, s-post, s-put etc.

I would prefer to avoid shelling out to these scripts when I need to load data, 
but I can't quite figure out what a multipart message body needs to look like 
to be accepted. The Ruby script mechanism seems to be described here: 
https://www.w3.org/TR/2013/REC-sparql11-http-rdf-update-20130321/#http-post

Sadly the perl libraries that support streamed content can only do so via a 
more proper POST body with key:value pairs. I really shouldn't have to write my 
own streaming code for this, so can somebody explain what multipart requests 
Fuseki can understand? If any?


Kieron


Hi Kieron,

s-post and s-put don't require a multipart request. Just send the RDF data and set the Content-type header. s-post/s-put guess the Content-type for you but you can do it directly in a language of your choice or exec "curl".

Example:

curl -XPOST --header "Content-type: text/turtle"   \
     --data-binary @DATA.ttl                       \
    http://localhost:3030/ds

However, that may load the file into curl's RAM. (reading from https://github.com/curl/curl/issues/290)

If you want to do it like an HTML file upload:

curl -F "[email protected];filename=DATA.ttl" http://localhost:3030/ds

which streams a large file which si the multipart form style.

Programmatically, open an HTTP connection with
"Content-type: text/turtle" and push the RDF bytes down it. Fuseki does not require "Content-length".

    Andy

Reply via email to