Wednesday, June 13, 2007

Web Sites, Web Applications, and Content Types

I couldn't find this reference when I was looking for it the other day.

Good Web APIs are just Web Sites

Excellent!

Both that presentation and an RDF Shopping example use content negotiation to serve different content types to clients. My previous signposts entry used a pretend HTML microformat. Different strategies for transferring understandable content from server to client.

The question I'm still asking myself is which of these two choices is better and why?:
  1. Separate and negotiated media types
  2. Single extensible media type
I have to admit, I find conneg to be non-Visible. I just don't feel very comfortable with it.

Candidates for extensible media types are HTML microformats and RDF (and Topic Maps and DITA and SGML Architectures).

The HTML Web has flourished (in part) because of Postel's Law:
"Be liberal in what you accept, and conservative in what you send."
Is that enough to encourage using fewer, but extensible, media types over individual crafted media types?

3 comments:

Anonymous said...

John,

We on the simplewebservices.org working group have been grappling with these issues very recently.

We have reached a consensus on how we intend to proceed in relation to this. We will support "robust" services using RDF at high fidelity and "easy" services using JSON or HTML+microformats at a lower fidelity using server-driven content negotiation, i.e.

"robust"
Accept: application/rdf+xml

"easy"
Accept: text/json
or
Accept: text/html, */*

See:
http://tech.groups.yahoo.com/group/simplewebservices/message/120

IMO, this resolves a common conflict in REST between browsers and non-browser User Agents. It also favours the use of open, generic content types.

I am heading up the "robust" approach and Mike Schinkel will head up the "easy" approach.

http://simplewebservices.org

John Heintz, President Gist Labs said...

Alan,

I've subscribed to the list and checked out that thread.

To summarize: Different audiences will want one, or the other.

I'm still not sure it's that simple.

For example #4: Application vendors (leading to ecosystem of autonymous agents).

These agents would need service providers to support the application/rdf+xml content type. Asking that of many (the long tail?) content providers is going to be tough.

John

Anonymous said...

Our current thinking is that this is where pubishing frameworks that can be leveraged come into play. We plan on providing some open source "reference frameworks" to kick off the process.