Skip to content

Commit adeea8e

Browse files
committed
Example to transform from NGSI Normalized to Simplified
(Not taking care of date nor ids/uris string changes)
1 parent 54422d0 commit adeea8e

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
$merge($each($, function($v, $k) { $exists($v.value) ? { $k:$v.value } : $exists($v.object) ? { $k:$v.object }: { $k:$v } }))

examples/smart-data-transforms.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
[
22
{
3+
"description": "Transformation from NGSI v2 models from 'Normalized response representation' (JSON-LD version partially supported) to 'Simplified representation'",
4+
"query": "type and *.value",
5+
"cases": {
6+
"true": "https://raw.githubusercontent.com/alexandrainst/node-red-contrib-json-multi-schema/master/examples/NGSI-Normalised-to-keyValues.jsonata.js"
7+
}
8+
},
9+
{
10+
"description": "Custom local example",
311
"query": "type='BasicVehicle' and latitude",
412
"cases": {
513
"true": "https://raw.githubusercontent.com/alexandrainst/node-red-contrib-json-multi-schema/master/examples/OldVehicleToVehicle.jsonata.js"

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "node-red-contrib-json-multi-schema",
3-
"version": "0.3.4",
3+
"version": "0.3.5",
44
"description": "Generic JSON data pipeline tools, with dynamic transformation (using JSONata rules), resolving JSON Schema (using JSONata rules), and then validation (using JSON Schema). For Node-RED and for command-line.",
55
"main": "index.js",
66
"readmeFilename": "readme.md",

0 commit comments

Comments
 (0)