Place Your Bets on the HTTP PATCH Method

Partial updates are somewhat problematic in the world of RESTful applications. Currently, we use POST and PUT to write data or update it, but on sub-properties of data updates, it actually can get somewhat hard to code for when you get into the more subtle application logic and error management, let alone on datasets that are very large or have very deeply nested data structures in a single JSON object, for example.

But, regardless, PUT and POST have done a satisfactory job up until now, and nobody really needs to use PATCH in a relational context. But therein lies an interesting point: data is getting bigger, and naturally, semantic data is starting to become much more prevalent, and its URI-based. It logically follows that if data continues to become more semantic, and you’re dealing more often in deeply nested structures, you’ll need a URI-based updating method that can be more flexible than PUT and POST.  But you don’t have to take my word for it, lets ask an expert.

Arnaud Le Hors of IBM made a really interesting point about this very topic when talking about the role of semantic data in IBM products, saying “HTTP PUT is not enough. We need a PATCH method. There is a draft standard HTTP extension for PATCH, and I know that the SPARQL update community has a particular view of how PATCH should work. W3C needs to work on how PATCH would work in the context of RDF.

He went on to say, “In adopting linked data in products, we have found that there may be multiple ways to achieve the same end, and no clear guidance or consensus on which to use where. So we are seeking guidance on how to use various technologies and we look for the W3C to organize discussions with industry on linked data good practices. Some examples of constructs where we would like to see industry converge include containers, lists, and pagination (requesting a piece of a representation). The Workshop was about these sorts of linked data “patterns” and we are looking forward to formally addressing these issues in the new Linked Data Platform Working Group.” (link)

My prediction is this: in 5 years, semantic data will be much more popular than it is today, and as a result, applications built around semantic data will also be using the latest and greatest standards and technology. Thus, we’ll see a natural progression toward RESTful interfaces that rely much more heavily on the PATCH method.

Comments are closed.