A bidirectional transformation consists of a function get that takes a source (document or value) to a view and a function put that takes an updated view and the original source back to an updated source, governed by certain consistency conditions relating the two functions. Both the database and programming language communities have studied techniques that essentially allow a user to specify only one of get and put and have the other inferred automatically. All approaches so far have been syntactic in nature, either proposing a domain-specific language with limited expressiveness but built-in (and composable) backward components, or restricting get to a simple syntactic form from which some algorithm can synthesize an appropriate definition for put. Here we present a semantic approach instead. The idea is to take a general-purpose language, Haskell, and write a higher-order function that takes (polymorphic) get-functions as arguments and returns appropriate put-functions.
In the world of 3D computer graphics Pixar are the ‘King of the hill’ and their Reyes Image Rendering Architecture defines a very powerful image processing pipeline that is used for the transformation of complex graphics primitives into smaller, simpler primitives that are easier to sample and rasterize. The keyword in the last sentence was transformation, and XSLT is very good at transforming hierarchical data structures like computer graphics models.
JSON is a lightweight text format for data interchange. It is often better suited for structured data than XML.
A frequently requested task with JSON data is its transformation to other formats, especially to XML or HTML for further processing.
The most obvious way to achive this, is to use a programming language (ECMAscript, Ruby,…) and the DOM-API.
In XML we can transform documents by another XML document containing transformation rules (XSLT) and applying these rules using an XSLT-processor.
Adopting that concept I have been experimenting with a set of transformation rules (written in JSON).
As a result in analogy to XML/XSLT the combination JSON/JSONT can be used to transform JSON data into any other format by applying a specific set of rules.
JSON is a lightweight text format for data interchange. It is often better suited for structured data than XML.
A frequently requested task with JSON data is its transformation to other formats, especially to XML or HTML for further processing.
The most obvious way to achive this, is to use a programming language (ECMAscript, Ruby,…) and the DOM-API.
In XML we can transform documents by another XML document containing transformation rules (XSLT) and applying these rules using an XSLT-processor.
Adopting that concept I have been experimenting with a set of transformation rules (written in JSON).
As a result in analogy to XML/XSLT the combination JSON/JSONT can be used to transform JSON data into any other format by applying a specific set of rules.