JSONExploder

From fmepedia

JSONExploder is a Workbench Transformer.

The JSONExploder is used to extract portions of JSON formatted text into new FME features. The 'JSON Attribute' parameter identifies the feature attribute which contains the JSON text. The 'JSON Query' parameter is the JSON query referring to the JSON values which will become new FME features.

A JSON query is a mechanism to refer to values inside JSON text. The outermost JSON value, which must be an object or an array, is always referred to by the term 'json'. Contained values can be referred to using JavaScript like square bracket index operators. A value in an array can be referred to using its zero-based position in the array (ie. 'json[2]' for the third element). A value in an object can be referred to using its object key name (ie. 'json["key"]' ). All of the values in an array or object can be referred to collectively using a wildcard index (ie. 'json[*]'). The query used by this transformer can have multiple expressions, which are separated by a '+' operator. This allows the transformer to refer to values in different areas of the JSON text (ie. 'json["resultSet_1"][*] + json["resultSet_2"][*]'). More information on JSON queries can be found in the JSONQueryFactory documentation.

For each newly created feature, the attribute identified by the 'JSON Attribute' parameter will contain JSON text referred to by the JSON query. The json_type attribute will contain the JSON type of the text (object, array, string, etc) and the json_index paramter will contain the object key or array index of the JSON value.

If the JSON query cannot be fully evaluated, a message will be logged, and the translation will continue.

More information on JSON can be found here:

WeatherMap workspace shows example use of JSONExploder.

Attached Files
filesizedate
index.php------
User Comments Add a new comment