Loading ...
Sorry, an error occurred while loading the content.
 

Re: [rest-discuss] Representation format as part of URIs?

Expand Messages
  • Roy T. Fielding
    ... Those are two different resources. If a person wishes to identify the XML representation of a concept, an HTML response to that resource would not be a
    Message 1 of 19 , Dec 17, 2002
      > Does that mean that I don't have to rely on content negotiation for
      > choosing the format of the response? So, it would be RESTful to have
      > those two URIs for example
      >
      > http://www.physicists.org/html/list-of-physicists
      > http://www.physicists.org/xml/list-of-physicists
      >
      > although the representations they return are
      > representations of the same resource (concept) and only differ
      > in the markup language used ?

      Those are two different resources. If a person wishes to identify
      the XML representation of a concept, an HTML response to that resource
      would not be a valid representation even though it may have essentially
      the same content. If the resource is a concept independent of
      representation format, then its URI must not have any aspect
      that is specific to the representation format. Having that aspect
      in the URI (as interpreted by the origin server) implies that the
      resource semantics includes the format.

      BTW, for server-contructed URI, there is no effective difference
      between query and path info -- both distinguish a resource. It is
      only when the URI is client-constructed (as in GET forms or ISINDEX
      or the old server-side image maps) that the client has any way to
      distinguish the non-query path as a resource, and even then the
      various URI with the query info tagged-onto the end identify separate
      resources.

      A resource is defined not by its implementation, but by a user's
      expectation of results from future actions on that resource.
      If two URI are expected to respond to GET differently, then they
      must identify different resources.

      ....Roy
    • Paul Prescod
      ... 2396 is not clear about that. It says: 3.4. Query Component The query component is a string of information to be interpreted by the resource. Paul
      Message 2 of 19 , Dec 17, 2002
        Roy T. Fielding wrote:

        >
        > BTW, for server-contructed URI, there is no effective difference
        > between query and path info -- both distinguish a resource. It is

        > only when the URI is client-constructed (as in GET forms or ISINDEX
        > or the old server-side image maps) that the client has any way to
        > distinguish the non-query path as a resource, and even then the
        > various URI with the query info tagged-onto the end identify separate
        > resources.

        2396 is not clear about that. It says:

        "3.4. Query Component

        The query component is a string of information to be interpreted by
        the resource."

        Paul Prescod
      • Roy T. Fielding
        ... Yes, but it doesn t say that the resource is identified by what comes before the query component. ....Roy
        Message 3 of 19 , Dec 17, 2002
          > 2396 is not clear about that. It says:
          >
          > "3.4. Query Component
          >
          > The query component is a string of information to be interpreted by
          > the resource."

          Yes, but it doesn't say that the resource is identified by what comes
          before the query component.

          ....Roy
        • Miles Sabin
          Roy T. Fielding wrote, ... True, but puzzling. If the resource is identified by the whole URI then, 1. http://www.example.com/foo?bar and, 2.
          Message 4 of 19 , Dec 18, 2002
            Roy T. Fielding wrote,
            > > 2396 is not clear about that. It says:
            > >
            > > "3.4. Query Component
            > >
            > > The query component is a string of information to be interpreted
            > > by the resource."
            >
            > Yes, but it doesn't say that the resource is identified by what comes
            > before the query component.

            True, but puzzling.

            If the resource is identified by the whole URI then,

            1. http://www.example.com/foo?bar

            and,

            2. http://www.example.com/foo?baz

            identify two distinct resources R1 and R2, in which case there doesn't
            seem to be very much "interpretation" to be done: "?bar" is encoded
            into the identifier for R1 and "?baz" is encoded into the identifier
            for R2, so any further inspection of the query component by either
            resource would be redundant.

            Whatever the currently preferred understanding of the relationship
            between URIs, resources and representations, 3.4 only really makes any
            sense if we treat the prefix,

            http://www.example.com/foo

            as identifying a _process_ and the query component as specifying an
            argument to be provided to that process.

            But that pretty clearly isn't your currently preferred understanding,
            which, even if it's not strictly speaking inconsistent with 3.4,
            certainly seems to be in tension with it. So maybe 3.4 needs tweaking?

            Cheers,


            Miles
          • Roy T. Fielding
            ... That s already on the issues list due to a couple other issues. ....Roy
            Message 5 of 19 , Dec 19, 2002
              > But that pretty clearly isn't your currently preferred understanding,
              > which, even if it's not strictly speaking inconsistent with 3.4,
              > certainly seems to be in tension with it. So maybe 3.4 needs tweaking?

              That's already on the issues list due to a couple other issues.

              ....Roy
            Your message has been successfully submitted and would be delivered to recipients shortly.