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

Re: [rest-discuss] Is it possible to make a cgi like app restful?

Expand Messages
  • Andrew Hallam
    Hi Mike, ... Agreed, but I m new to discussing REST and wasn t sure how to better express myself. ... Sure, but I guess I m just uncomfortable putting real
    Message 1 of 12 , Nov 15, 2004
    • 0 Attachment
      Hi Mike,

      > I wish there were more dimensions to our analyses than just
      > the ambigous 'RESTfulness'.

      Agreed, but I'm new to discussing REST and wasn't sure how to better
      express myself.

      > There are an innumerable number of geographic regions identifiable
      > via a min/max coordinate and it doesn't matter whether the value
      > are place in path segments or in query terms - the resource
      > identifier encompasses both.

      Sure, but I guess I'm just uncomfortable putting real numbers of
      arbitrary precision in a URI path because it seems messy. I'll try to
      explain why.

      I'm sticking to the original topic of WMS GetMap requests.

      A GetMap request requires minX, minY, maxX and maxY values (real
      numbers) to define the geographic extent of the map image, plus the X
      and Y size of the map image in pixels (integers). Roughly speaking,
      these values determine the view scale of the map image.

      If the view scale is small (think of a map of Australia), delivered in a
      500 x 350 pixel image, it doesn't matter if you ask for that map using:

      minX = 110 (decimal degrees)
      minY = -45
      maxX = 160
      maxY = -10

      or (exaggerating the issue)

      minX = 110.0000001
      minY = -44.95999999999
      maxX = 160.0000000001
      maxY = -9.9999999999

      you will probably get the same map representation (when the two images
      are compared pixel by pixel). Therefore, if you put the X/Y coordinate
      values in the URI path there are numerous URIs that identify the same
      resource, which is perfectly legal. (Obviously, there are just as many
      possible URIs when using query parameters.)

      As a matter of style, putting the X/Y coordinate values in the query
      parameters seems to make more sense to me. It could be all put in a URI
      path but sometimes it is useful to see the parameter names and values
      (and order doesn't matter).

      I tend to think of URI paths as being composed of discrete values.
      Habit, I guess.

      --
      Regards
      Andrew Hallam

      Digital Earth Pty Ltd
      http://www.digitalearth.com.au
    • Josh Sled
      ... That s exactly what I was getting at -- the hypermedia constraint continues to be a useful one, even when it s not a human at the end of the browswer.
      Message 2 of 12 , Nov 15, 2004
      • 0 Attachment
        On Sun, 2004-11-14 at 19:36, S. Mike Dierken wrote:

        > > > Josh's suggestion of using hypermedia has actually been
        > > > implemented by WMS clients.
        > >
        > > I understand what Josh is saying, but I disagree with him on this one
        > Without knowing what you two are talking about at all, I can suggest that
        > hypermedia is not restricted to user interface display. It can be used to
        > decouple systems from knowing the specific format and syntax of resource
        > identifiers. This would be one way for a map service to use path segments
        > and a different vendor use query terms. The tradeoff is that the document
        > format would have to be agreed upon, but implementors would be free to
        > choose varying resource identifier formats.

        That's exactly what I was getting at -- the hypermedia constraint
        continues to be a useful one, even when it's not a human at the end of
        the browswer.

        While a human might require a full and verbose HTML form to come back at
        each step in the interaction cycle, an automaton might only require...

        <map xmlns="http://path/to/map/description" />

        ....to come back in response to -- say -- `GET /map`. That is, the xml
        namespace of the document itself might be the hyperlink to some
        aggreed-upon-format describing how to interact with the service.

        While `xmlns` might be a bit of a stretch w.r.t. retrievability [for
        some strange reason], subst in RDF and you're good.


        Another useful non-HTML-format response might be a "term map" ... where
        WMS is just one "syntax" of interface exposed by some more general
        service ... JMS [for "jsled's mapping service" ] might be the other.

        The response to `GET /` might then be something like...

        <mappings xmlns="http://ns.eg.org/term-mapping-namespace">
        <map to="http://ns.wms.org/mapping">
        <mapping they-say="tomatoe" we-say="tomato" />
        <mapping they-say="potatoe" we-say="potato" />
        </map>
        </mappings>

        But it's really hard to see how to make that format work generally
        unless the underlying service is already basically a 1-1 mapping, in
        which case it's probably easier to have the server be responsible for
        doing the mapping.


        In any case, assuming some sort of top-level GET returns a
        resource+service-description language, the automaton can probably
        understand a whole set of coordinated interaction exchanges in response
        to receiving that one root-level document. This is weird, because it's
        in direct conflict with why the web works so well -- the server is the
        director's chair, and at a relatively fine grain. At the same time,
        humans consuming web services are different from automatons doing the
        same, and I think a hybrid approach will probably work pretty well.

        ...jsled

        --
        http://asynchronous.org/ - `a=jsled; b=asynchronous.org; echo ${a}@${b}`
      • Sandeep Shetty
        ... IMO, using query parameters has specific implications and is not just a matter of convenience. Query parameters are meant for user-driven options and since
        Message 3 of 12 , Nov 17, 2004
        • 0 Attachment
          Quoting "S. Mike Dierken" <mdierken@...>:
          > Using query parameters is a convenience and does not change any
          > 'RESTfulness' of an application. I wish there were more dimensions to our
          > analyses than just the ambigous 'RESTfulness'.
          > There are an innumerable number of geographic regions identifiable via a
          > min/max coordinate and it doesn't matter whether the value are place in path
          > segments or in query terms - the resource identifier encompasses both.

          IMO, using query parameters has specific implications and is not just
          a matter of convenience. Query parameters are meant for user-driven
          options and since there is only one query portion in a URI, don't you
          think it should be used judiciously?

          More info in a post by Roy:
          http://groups.yahoo.com/group/rest-discuss/message/4100


          Quoting Yao Heling <yaoheling@...>:
          > In a word, my question can be shortened to: is it
          > restful to use URLs
          > consisting of heaps of Key-Value Pairs?

          Since what your working with is not necessarily a hierarchical name
          space, you should also check out:
          Matrix URIs by Tim Berners-Lee
          http://www.w3.org/DesignIssues/MatrixURIs.html

          I like the idea of using the Path Component rather than the Query
          Component for reasons mentioned above.

          Sandeep Shetty
        • Jon Hanna
          ... Key-value pairs is RESTful (or at least can be) whether it s in the form or the form
          Message 4 of 12 , Nov 17, 2004
          • 0 Attachment
            > > In a word, my question can be shortened to:
            > > is it restful to use URLs consisting of heaps
            > > of Key-Value Pairs? Josh's suggestion of using
            > > hypermedia has actually been implemented by WMS
            > > clients.
            >
            > I don't believe there is any constraint in REST
            > that says you cannot use heaps of name/value pairs
            > in URLs. There may however be practical limits
            > that suggest it may not be a good idea.

            Key-value pairs is RESTful (or at least can be) whether it's in the form
            <http://www.example.net/ex/x/y/a/b> or the form
            <http://www.example.net/ex?x=y;a=b>.

            The fact that /x/y/a/b may be equivalent to a/b/x/y and ?x=y;a=b may be
            equivalent to ?x=y&a=b and ?a=b;x=y and ?a=b&x=y does bring issues of
            cachability if all forms are being used, but this is also true of
            case-insensitive handling of URIs etc. and solved by using a canonical form.

            Regards,
            Jon Hanna
            Work: <http://www.selkieweb.com/>
            Play: <http://www.hackcraft.net/>
            Chat: <irc://irc.freenode.net/selkie>
          • Sandeep Shetty
            ... IMO, using query parameters has specific implications and is not just a matter of convenience. Query parameters are meant for user-driven options and since
            Message 5 of 12 , Nov 17, 2004
            • 0 Attachment
              Quoting "S. Mike Dierken" <mdierken@...>:
              > Using query parameters is a convenience and does not change any
              > 'RESTfulness' of an application. I wish there were more dimensions to our
              > analyses than just the ambigous 'RESTfulness'.
              > There are an innumerable number of geographic regions identifiable via a
              > min/max coordinate and it doesn't matter whether the value are place in path
              > segments or in query terms - the resource identifier encompasses both.

              IMO, using query parameters has specific implications and is not just
              a matter of convenience. Query parameters are meant for user-driven
              options and since there is only one query portion in a URI, don't you
              think it should be used judiciously?

              More info in a post by Roy:
              http://groups.yahoo.com/group/rest-discuss/message/4100

              Quoting Yao Heling <yaoheling@...>:
              > In a word, my question can be shortened to: is it
              > restful to use URLs
              > consisting of heaps of Key-Value Pairs?

              Since what your working with is not necessarily a hierarchical name
              space, you should also check out:
              Matrix URIs by Tim Berners-Lee
              http://www.w3.org/DesignIssues/MatrixURIs.html

              I like the idea of using the Path Component rather than the Query
              Component for reasons mentioned above.

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