One of the domains for which data lends itself well to be represented as a graph is trade. We can take any tradable good, represent the trading actors as nodes, and represent the (amount of) traded goods as (properties of) edges. As an example, the graph below displays the international trade of fish in 1998 (source data), where the nodes represent countries, the sizes of nodes represent the total exports per country, and the edges represent the fact that the edge’s source country exported a given amount of fish to the destination country:
I previously blogged about shell scripting JSON with Node.js. In this post, I’ll demonstrate how to achieve the same thing with jsawk. The way these things go, I didn’t find out about jsawk until after I wrote my post about shell scripting with Node. It’s good to know both .
Jsawk, as the name implies, aims to be for json what awk is for structured plain text. It’s rather useful, as it saves a lot of setup/boilerplate compared to the node.js scripts I’ve shown before.
I’m currently in a project team working on an application that stores much of its data in CouchDB. One of the lovely things about Couch is its RESTful API. It’s all simple HTTP and JSON, easy to understand and easy to program to.
One aspect where this interface isn’t so readily accessible is in shell scripting. There’s curl to handle all the HTTP stuff we could ever need, but to transform a JSON structure or extract information from it proved less straightforward. We can cover simple cases with grep and awk, but JSON is complex enough that we (or, well, I) wouldn’t want to. If the documents were XML, we could have used xpath and xslt to do our heavy lifting. There is to my knowledge no equivalent to xmlstarlet for JSON to reliably handle these chores.
We solved our shell scripting problem and the solution is dead obvious, Read more
In two previous posts, we have seen how to develop RESTful application with JBoss AS 7. At the end of the second blog we used a generic REST client tool to execute some RESTful web services. Of course we would rather build a custom UI application as client for our services, so that a user can easily access and manipulate the data. In this blog we build a REST client that is based on the master-detail principle.
When working on a mobile Android application, I was confronted with the fact that the backend server wasn’t available yet to deliver the REST service. But I needed a server or good dummy for testing the Android client against the REST services. So I began my search for a REST mock server.
I started out using the SoapUI REST functionality, but that still lacks a good implementation for my purpose of reacting on REST calls. I ended up with a 10-minute build-your-own REST mock using the Play framework. This blogs describes how this was accomplished.