W3C home > Mailing lists > Public > public-rdf-dawg@w3.org > July to September 2009

Re: [ISSUE-32] Implications of updates on protocol, regarding HTTP methods

From: Jacek Kopecky <jacek.kopecky@sti2.at>
Date: Wed, 29 Jul 2009 22:25:47 +0200
To: Paul Gearon <gearon@ieee.org>
Cc: public-rdf-dawg@w3.org
Message-Id: <1248899147.16222.43.camel@Kalb>
A few comments, if I may.

On Wed, 2009-07-29 at 13:05 -0500, Paul Gearon wrote:
> Option 1: Write an unrelated new protocol for the HTTP binding
> SPARQL/Update to operate on.
> This would appear to be duplicating some work, and still needs to
> address how modifying operations need to be called.

Seeing Andy's reply, I think this would be preferable, for clarity. This
way, updates would simply not be allowed through GET and people couldn't
shoot themselves in the foot here. I consider all non-safe uses of GET
to be broken and short-sighted.

> Option 2: All modifying operations go through POST.
> While not mandated, the standard use of POST is to provide all data in
> the body. This is how the query operation works. This may inconvenient
> for applications that may want to execute a simple operation that can
> be encapsulated in the URI.

This would be the easiest option, I suspect - POST with the whole query
in the body. I'd advocate it if I weren't a lurker here.

Without a body, POST basically says "do something with this nothing (the
body) at the given resource", so the "something" needs to be identified
by the resource, and that is awfully close to putting the verb in the
URI, a commonly frowned-upon practice.

> Option 3: All modifying operations go through PUT with a fallback to
> POST for large commands.
> This is similar to the definition of query which uses GET and POST.
> However, this is awkward if doing a PUT or a POST for a command that
> is trying to delete resources, such as triples or graphs, as the
> expected semantics of these methods is to add data to a server. Also,
> PUT is more tightly defined than POST, expecting a resource in the
> URI, while a different resource MUST be referred to with a different
> URI.

PUT is for replacing of the whole identified resource. You could stick
the "where" part in the URI and the update specification in the body,
and a similar thing with POST and DELETE, but it feels contrived.

> Option 4: Use appropriate methods for each action.
> This means using PUT to create resources, DELETE to remove them, GET
> and HEAD to query them. However, this is what the REST protocol will
> be doing, and makes the notion of a SPARQL/Update language
> superfluous.

PUT is only useful for resource creation if the client can be trusted to
create the right URIs. For adding things into collections, POST is more
appropriate.

Just hoping to clarify things, maybe,
Jacek
Received on Wednesday, 29 July 2009 20:26:28 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 16:15:39 GMT