{ "kind": "open-flow-workflow", "version": 1, "name": "Compare Example Fruit Datasets", "content": { "modelVersion": 14, "document": { "bindings": {}, "graph": { "nodes": { "n_101bcee29b218203": { "name": "Run the comparison", "kind": "start", "inputDefs": [] }, "n_e8c5ad5213b7a805": { "inputs": {}, "name": "Compare the fruit examples", "kind": "task", "task": { "inputs": [], "outputs": [ { "jsonSchema": { "type": "array", "items": { "type": "object", "additionalProperties": true } }, "nullable": false, "handle": "aOnly" }, { "jsonSchema": { "type": "array", "items": { "type": "object", "additionalProperties": true } }, "nullable": false, "handle": "same" }, { "jsonSchema": { "type": "array", "items": { "type": "object", "additionalProperties": true } }, "nullable": false, "handle": "different" }, { "jsonSchema": { "type": "array", "items": { "type": "object", "additionalProperties": true } }, "nullable": false, "handle": "bOnly" } ], "name": "Compare the fruit examples", "moduleId": "n_362a322c4b11e28d", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_9a28c09bf9b5abd4": { "name": "Comparison results", "kind": "outputs", "outputDefs": [ { "jsonSchema": { "type": "array", "items": { "type": "object", "additionalProperties": true } }, "nullable": false, "handle": "aOnly" }, { "jsonSchema": { "type": "array", "items": { "type": "object", "additionalProperties": true } }, "nullable": false, "handle": "same" }, { "jsonSchema": { "type": "array", "items": { "type": "object", "additionalProperties": true } }, "nullable": false, "handle": "different" }, { "jsonSchema": { "type": "array", "items": { "type": "object", "additionalProperties": true } }, "nullable": false, "handle": "bOnly" } ], "outputMappings": { "aOnly": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_e8c5ad5213b7a805", "output": "aOnly" } ] }, "same": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_e8c5ad5213b7a805", "output": "same" } ] }, "different": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_e8c5ad5213b7a805", "output": "different" } ] }, "bOnly": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_e8c5ad5213b7a805", "output": "bOnly" } ] } } } }, "edges": [ { "source": "n_101bcee29b218203", "target": "n_e8c5ad5213b7a805" }, { "source": "n_e8c5ad5213b7a805", "target": "n_9a28c09bf9b5abd4" } ] } }, "modules": { "n_362a322c4b11e28d": { "name": "Compare the fruit examples", "imports": [], "source": "export default function compare(){const a=[{fruit:'apple',color:'green'},{fruit:'orange',color:'orange'},{fruit:'grape',color:'green'},{fruit:'strawberry',color:'red'},{fruit:'banana',color:'yellow'}],b=[{fruit:'apple',color:'green'},{fruit:'grape',color:'purple'},{fruit:'orange',color:'orange'},{fruit:'kiwi',color:'mostly green'},{fruit:'banana',color:'yellow'}],aOnly=[],same=[],different=[],bOnly=[];for(const x of a){const y=b.find(v=>v.fruit===x.fruit);if(!y)aOnly.push(x);else if(x.color===y.color)same.push(x);else different.push({keys:{fruit:x.fruit},same:{fruit:x.fruit},different:{color:{inputA:x.color,inputB:y.color}}})}for(const x of b)if(!a.some(v=>v.fruit===x.fruit))bOnly.push(x);return{aOnly,same,different,bOnly}}\n" } } }, "presentation": { "designer": { "version": 1, "flow": { "direction": "vertical" } } } }