How to Reach [EV] REST Level 5: the Summit 3

Posted by Patrice Cappelaere Wed, 07 Nov 2012 16:18:00 GMT

At RESTFest 2012, Stu Charlton’s keynote described user agents acting on behalf of users, crawling the web for activities they could perform to meet user goals.  He presented the idea of using linked behavior trees.  Hummm… seemed easier said than done… but what an incredible vision!  How can we get there?

The journey starts at Richardson’s REST level 3.  You need to have hypermedia controls, action links and code on demand… In our case, javascript is a necessity as it can be requested on-demand and executed on the client side as well as on the server side.  You can find more background info in my previous slides.

The next step is to think in terms of user activities (or GeoActivities for the OGC community interested in location and spatial objects).  Activities are made of {verb} {object} [{target} {context}].  When performed, they can be output as activity streams.  They can be published and queried at will.  To perform a goal, many activities may be performed remotely by one or more web applications.  For every web application, a local behavior tree needs to be assembled to cobble up specific activities to be performed to meet a specific goal.  From a user standpoint, a goal is an "prized" object of interest.

For example, In our case, a user may be interested in a "floodmap" for a specific area of the world at a specific lat/long in some format (GeoTiff or KMZ).  A distributed query can fetch (as links returned from the query) local behavior trees from existing services (MODIS, RADARSAT-2 and EO-1).  Some of those services may even task a satellite and process the data to meet the user request while another may retireve the daily MODIS floodmap product.  Local trees are asembled on the client side in a bigger tree to be executed in parallel to completion.  One or more products are acquired and made available through links to our user.  A piece of cake :)

Behavior trees can be expressed in JSON.  Each node is an activity expressed by a verb that enacts the behavior for that state.  That activity may or may not be executed depending on context.  You have to define a guard to allow or reject the state transition and move to another state as required or continue on.

The basic code can be found there.  You may need to tweek it slightly to run under node.js.  Thank you Marie Rose Cook for sharing it.  A user-agent can now request the local behavior trees and execute them on the client side.  Pretty cool!

To describe activities and objects a little better, you may want to check out the Facebook OpenGraph approach.  They have an interesting lightweight RDFa approach to link "big" data within social networks.  Querying for local tree may entail a little SPARQL or FQL.

So here it is: REST Summit at level 5.

Enjoy the view.




Leave a comment

  1. Avatar
    Luke Stokes about 2 hours later:

    Great post, Pat. That keynote blew my mind (as it did most of us there, I think). It’s great to see a real world example I can (almost) wrap my head around. Hopefully once I get more experience on the ground level (i.e. REST), I can dive into these ideas as well.

  2. Avatar
    Matt Bishop 1 day later:

    Hi Pat,

    Where’s level 4? I am looking forward to examining your work in some detail when I get a chance. Maybe it is described therein.

  3. Avatar
    Pat Cappelaere 1 day later:

    Hey Matt,

    I think I left some breadcrumbs to point to two slide decks on my slideshare account. Level 4 is reached when you have defined all potential user activities (and can generate activity streams to social networks). Hope to see you in NYC at the API conference…