Thinking about JSON… Schema definition for JSON? RESTful presentation & transformation services for JSON?
Since I have been working with JSON, I have had a lot of ideas and questions regarding its use, validation and presentation. JSON is overwhelmingly being preferred over XML these days for most applications since most of them are web-based. Given its quick acceptance for various applications, do we need other supporting standards and technologies for JSON like XML’s XSD and XSLT technologies. When I was pouring over the GeoJSON standard when working on the GeoJSON.NET library, I couldn’t help but wonder if the GeoJSON standard should be expressed in a schema definition language for JSON like the XSD for XML. I don’t believe validating JSON data against such a schema definition would be practical right now, given that the validation will be processor and memory intensive and may not be a great idea on the client-side browsers. I did find Kwalify and Cerny which seem to take a stab at it. It will be interesting to see whether such technologies will develop further.
In the above URL, the ‘[jsonURL]’ represents the URL that GETs the JSON data and ‘[HTML]’ tells the service the format to which the JSON data needs to be transformed to. I don’t think this kind of RESTful presentation services for data is anything new. There are similar services available right now even for GIS but not exactly JSON data. The service I am referring to is one of VirtualEarth’s services to view KML data(not GeoJSON, but hopefully that is coming soon). It should be a breeze to build a similar service for GeoJSON using OpenLayers since it can consume GeoJSON data directly as a layer. One example of an OpenLayers app consuming GeoJSON data can be found here. The GeoJSON data is obtained from here, which is a FeatureCollection of the boundary data for all countries.
URL FORMAT http://maps.live.com/?mapurl=[insert url here]