RE: Example for consideration: Resource versus Representation

+1 to Henry's reply.  And Pat's reply said almost exactly what I was going to say in some cases, but I do have a several comments to add.

> From: Pat Hayes
> To: Alan Ruttenberg
>
> At 11:34 PM -0500 1/22/08, Alan Ruttenberg wrote:
>
>       Are representations resources?
>
>
> They can be (anything CAN be a resource....), but its not
> usually very useful to want to treat them as resources, I'd say.

+1

>       I have heard the argument that they are not. In this
>     morning's call I agreed to send an example I've been thinking about.
>
>
>       Consider some Information Resource that responds to a
>     request with a Representation of type application/pdf.
>
>
> Wrong way to put it. You are making 'representation' into a
> category, but it should be a relationship. That thing you get
> back is required by the REST architecture to be a
> representation OF the IR. That is, whatever we call this
> thing you get back, it bears a webarch:represents
> relationship to the IR. Saying that doesn't say what kind of
> thing the representation is, only that it represents. So we
> can (using this confusing language we all speak) nominalize
> this and say that it 'is a representation', but that
> shouldn't be taken to mean that this means (or at any rate,
> that it means usefully) that it is a category of Things
> called Representations.

+1.  Another way I would put this: The notion of awww:representation is used in the context of describing a protocol: the awww;representation is what is successfully returned by a GET on a awww:resource.  In this sense it is a relative term.  It's like talking about the *reply* to a request: the concept of a reply only makes sense in relation to a request.  Similarly, the concept of a awww:representation only makes sense in the context of a request on a awww:resource.

>
>       I save the response on my hard disk.

But in some sense you cannot do that.  You can save the information *conveyed* by the response, but not the response itself.  The response itself is ephemeral --  an action.   However, as Pat points out, it is convenient to be sloppy and use the same word for both the action and the information it conveys.  Similarly, it's convenient to be sloppy and use the term awww:representation to refer to the bits that were conveyed by a awww:representation, because the awww:representation itself is ephemeral: the notion of a awww:representation only exists in relation to a particular request.

>     Is the thing I
>     have (henceforth known as the file)  on my hard disk an
>     Information Resource?
>
> Yes.

Well, that's a different question.  I and others have many times pointed out that the AWWW definition of Information Resource is seriously flawed, so unless we first agree on a workable definition, I think it is better to avoid asking that question.  However, it certainly can be considered a awww:resource if desired.

>
>       If it is, when and how did it become one, having been
>     only a Representation until recently?
>
>
> When you stored it (in fact when you *created* that file,
> based on the byte stream you got back from the first
> resource; that byte steam being the actual representation of
> the first IR, if one wants to be pedantic.) Being a file,
> stored stably in a computer, it can possibly (see below) be
> given a URI.

Another way to think of it: since anything can be considered a awww:resource, it becomes a awww:resource when it is created, either physically or conceptually.

> However, I see no way to give a URI to a byte stream.

Actually, I don't see any reason why a URI could not be minted for a particular awww:representation (the ephemeral notion), but it doesn't happen automatically, and as Pat mentioned above, it isn't usuaully useful to do so.

>
>       If not, what happens when I move the file to a
>     directory (actually, I don't move the file, I make changes to
>     directory structures) that my Apache server can serve from.
>     Can my server respond to requests for Representations?
>
>
> No, because it doesn't know that this file represents
> anything, so such a request is meaningless. But it can still
> serve the file.

Agreed, though I would state it differently: The ephemeral kind of awww:representation is not an Information Resource, so it cannot have a awww:representation.

>
>       If not, how should it avoid serving this file? If the
>     server answers requests only about Resources and is willing
>     to serve the file then the file must be a Resource. If it is,
>     same question: When and how did it become a Resource, having
>     only recently been a Representation?
>
>       It was suggested that perhaps Resources were only
>     Resources if they were identified by a URI.
>
>
> I think that idea has been floated and rejected by the TAG
> before. Its a resource if it can possibly be given a URI,
> even if it doesn't have one yet.

+1


David Booth, Ph.D.
HP Software
+1 617 629 8881 office  |  dbooth@hp.com
http://www.hp.com/go/software

Opinions expressed herein are those of the author and do not represent the official views of HP unless explicitly stated otherwise.

Received on Thursday, 24 January 2008 02:53:09 UTC