[Mulgara-dev] SPARQL handling of POSTed file uploads

Paul Gearon gearon at ieee.org
Sun Dec 26 17:37:24 UTC 2010


Since the point of these tickets is on the same operation, I thought
it might be best to respond in email first, rather than split comments
between tickets.

On Fri, Dec 24, 2010 at 1:11 PM, Gregg Reynolds <dev at mobileink.com> wrote:
> FYI, just created tickets 222 and 223 regarding handling of file uploads by
> ProtocolServlet.java.  The currently logic is basic and needs to be enhanced
> to better handle multiple file uploads, to send a usable response when
> uploading succeeds, etc.
> -Gregg

Yes, the current logic is simple. It's what I needed at the time. :-)

Just a quick comment on using X- on headers is not required, but
you're right... it's certainly best practice, and I should have done
it that way.

I never planned on this code being written for web pages to use. I
wrote it specifically for programatic access. You'll note that nothing
returned from any of the protocol servlets is HTML. As a result, I
thought that headers were just fine for returning info (and simpler
for me at the time). Of course, using headers led to problems when I
enabled multiple file uploads, as I didn't have a good way to indicate
that some worked and others didn't. So I think it's a good idea to
return this info in the body, as you suggest. However, in keeping with
the rest of the protocol, I'd like to use structured data in the
response, and not HTML, as I view HTML to be "human readable", and not
so useful for a programmatic interface. XML is my preferred choice
here. I'll mention this again at the end of the email...

Of course, this isn't so useful for HTML pages that want to use POST
to the protocol. Maybe we should have a discussion about that. As I
said, I never planned on this being used by HTML pages, unless it were
done via Javascript (which can get headers anyway, can't it?). It's
purely a programmatic API.

The real issue here is that I invented this protocol, trying to stick
to REST where I could. However, a real protocol is nearly here, and
everything in Mulgara's protocols will need to be updated to comply.
The preliminary document for this is at:
  http://www.w3.org/2009/sparql/docs/http-rdf-update/
It's getting close to final call, so most of this document has been
finalized and we should go ahead and update Mulgara to use it.

The new protocol does not cover things like multiple document uploads,
but I think it's a valid extension point, so we may be able to
continue doing it. I need to read that document more carefully to
ensure this. Whether it is or not, the current handling isn't correct,
and it needs to be updated.

As for responses, this has only just started to be discussed recently.
Richard Cyganiak wrote a comment to the SPARQL Working Group about
error responses in general. He wanted to see XML, while others thought
that plain text would be better. The SPARQL working group discussed it
a couple of weeks ago, and it seemed (to me) that the most popular
approach was to have a machine readable format. It's still not fully
defined though.

Incidentally, I appreciate that a completely SPARQL compliant protocol
may not be 100% suitable for what you want to use it for at the
moment. From my *personal* perspective, I'm not 100% happy with it
either (this is mostly because the protocol can't be directed
completely at Mulgara's approach to RDF since it needs to be general
purpose for all RDF stores). It's a good compromise though, so I'm OK
with it. But if you can write your system to talk to this protocol
(however awkward it may be) then you have a huge advantage in talking
to a standard.

So look over it and get back to me. I'll work through it with you, and
maybe we can have a compliant protocol by the end of the week.  :-)

Regards,
Paul

P.S. I haven't had a lot of time for Mulgara lately, and I've noticed
that same for a few other people too. However, I have the coming week
off, and we have snow forecast for today. So I'm planning on spending
a few hours a day on Mulgara, at least until New Year's. I even have
permission from my wife.  :-)


More information about the Mulgara-dev mailing list