Snap4City provides support for
- data ingestion/transformation and interoperability. Data may enter/exit in push via brokers of different kinds, and/or via dedicated processes in pull/push (enabling the data/event driven approaches). Data/Entities may be listed in some Entity Directory (IoT Models, Entity Model, Entity Instances, Smart Data Model of FIWARE, data spaces).
- Data/Entity may enter/exit from in push via Brokers of different kinds. All the brokers are managed by the Entity Directory / IoT Directory which registers them and registers any kind of Data/Entity Model including the Smart Data Model of FIWARE. The brokers can be internally managed (internal Brokers) or external which are managed by third parties. The integration of external brokers with their data/entity model and devices is automated, fast and easy. Please remind that brokers can be also used to act on entities/devices on the field.
- Data arriving in the platform are stored automatically on the Storage (Open Search) and / or can be sent directly to the user interface or to data analytics for stream processing. The same flow works as data driven from entering data/entities to dashboards and from dashboards to data streams for acting and sending commands, alarms, etc. Data collected and stored can be browsed by using the Entity Inspector / Data Inspector and Data Managers (HLT) for all the High-Level Types managed in the platform. From Entities, IoT, POI, maps, heatmaps, traffic flow, etc.
- Processing Logics could be in some ETL/ELT script. In Snap4City, Processing Logic / IoT App are Node-RED plus Snap4City microservices or Python processes (to push data in NiFi which is the gate to the storage, OpenSearch). Visual programming languages such as Node-RED, NiFi are typically preferred for rapid prototyping. These processes can be also allocated on cloud, fog, edge and on premise/field.
- Data/Entities may enter/exit in push or pull via processing Logic / IoT App as described above to manage data flow from any kind of protocol and format. Please remind that brokers can be also used to act on devices.
Data arriving in the platform are stored automatically on the Storage (Open Search) and / or can be sent directly to the user interface or to data analytics for stream processing. The same flow works as data driven from entering data/entities to dashboards and from dashboards to data streams for acting and sending commands, alarms, etc. Data collected and stored can be browsed by using the Entity Inspector / Data Inspector and Data Managers (HLT) for all the High-Level Types managed in the platform. From Entities, IoT, POI, maps, heatmaps, traffic flow, etc.
To satisfy the smart city requirements, in Snap4City, a collection of more than 190 MicroServices, as Nodes for the Node-RED programming environment, has been developed.
- https://flows.nodered.org/search?term=snap4city
- https://flows.nodered.org/node/node-red-contrib-snap4city-user
- https://flows.nodered.org/node/node-red-contrib-snap4city-developer
- https://flows.nodered.org/node/node-red-contrib-snap4city-d3-dashboard-widgets
- https://flows.nodered.org/node/node-red-contrib-snap4city-tunnel
- https://flows.nodered.org/node/node-red-contrib-snap4city-milestone
The Node-RED philosophy of visual programming allows for the creation of event-driven data flow applications, where the exchanged messages are in JSON format. On the other hand, periodic processes can also be developed by scheduling one or more internal timers. This means that users can develop Proc.Logic / IoT Apps as Node-RED flows, exploiting both Push and Pull data protocols, in the same visual programming environment. In the context of smart cities, both protocols are needed, while Proc.Logic / IoT Apps are capable of creating flows and exploiting a large number of features that are typically not available in the Node-RED open library, nor in several libraries from different providers. Moreover, the Snap4City MicroServices are at a level that can allow even non-expert users to easily develop Logic / IoT Apps for smart cities.
Actually, there are more than 180 nodes/blocks in the Snap4City libraries on IoT App which can really facilitate your life and save your time in producing Smart Applications for composition of the following microservices and using those that you can install from internet, thousands of functionalities:
• Data ingestion: more than 130 protocols IoT and Industry 4.0, web Scraping, external services, any protocol database, etc.
• Data access: save/retrieve data, query search on expert system, georeverse solution, search on expert system Km4City ontology, call to Smart City API, etc.
• Data Transformation/transcoding: binary, hexadecimal, XML, JSON, String, any format
• Integration: CKAN, Web Scraping, FTP, Copernicus satellite, Twitter Vigilance, Workflow OpenMaint, Digital Twin BIM Server, any external service REST Call, etc.
• Manipulation of complex data: heatmaps, scenarios, typical time trend, multi series, calendar, maps, etc.
• Access to Smart City Entities and exploitation of Smart City Services: transport, parking, POI, KPI, personal data, scenarios, etc.
• Data Analytic: managing Python native, calling and scheduling Python/Rstudio containers as snap4city microservices (predictions, anomaly detection, statistics, etc.)
• User interaction on Dashboard: get data and message from the user interface, providing messages to the user (form, buttons, switches, animations, selector, maps, etc.), send data to special graphical widgets: D3, Highcharts, etc.
• Custom Widgets: SVG, synoptics, animations, dynamic pins on maps, etc.
• Event management: Telegram, Twitter, Facebook, SMS, WhatsApp, CAP, etc.
• Special tools as: routing, georeverse, verify if a point is included into an area, Twitter Vigilance and sentiment analysis, get the closest civic number, distance from two GPS points, etc.
• Hardware Specific Devices: Raspberry Pi, Android, Philips, video wall management, etc.
• Etc. etc.
Moreover, the nodes in Snap4City can be also created by mapping some external API into a node. Thus, for the automated production of Nodes for Node-RED from API see:
- Creating new microservice nodes: https://www.snap4city.org/217
- tutorials of Node-RED. https://nodered.org/docs/creating-nodes/
- creating a new microservice node in node-red from some Rest Call API: https://www.snap4city.org/129
Snap4City Proc.Logic / IoT App with Debug Option
Snap4City added the extended debug capabilities, by using and extending CAULDRON tool. So that it is possible to attach at each Node extended debug capabilities. The integration of the CAULDRON offers the possibility of monitoring the passage of messages entering the Node-RED nodes, also providing the possibility of using breakpoints to block the flow through a node in order to be able to analyze it, make it proceed step-by- step, release the message queue held by the breakpoint or delete it. Specifically, the nodes of the CAULDRON version using the debug icon it is possible to see the trend of the last 10 messages. The graph draws lines if the plotted field contains an integer to highlight the value trend, otherwise it shows points to highlight the temporal trend. Clicking on the down arrow further modifies the interface. Nodes with both input and outputs provide other functionalities.
The three icons next to the messages label have the following functions:
- basket icon allows you to delete the entire history of messages received and sent by the node;
- link icon to open a pop-up that shows the history of messages received and sent by the node;
- airplane icon to inject a personalized message into the node.
- pause icon puts the node at breakpoint, allowing you to pause the flow. Messages arriving in the meantime are placed in a queue.
- Fast Forward icon allows you to extract the first message from the queue and let it continue the flow.
The Value field is an editable textbox containing the Json of the first message in the debug queue.
Snap4City enhanced version with respect to the original version of Cauldron allows you to select, through a special textbox present in each node, the attribute to be tracked.
The permitted syntax is the usual Javascript one, therefore for an object of the type:
{ A:[ {B:'0b', }, {B:”1b”, } ] }
Typing the expression A[0].B into the textbox shows the value '0b' while the expression A[1].B shows the value '1b'. If the expression does not match any attribute of the object, no results are shown. This functionality can be used in static ('static') or dynamic ('dynamic') mode: static mode means that the change of the textbox takes effect from the next message that crosses the node, while dynamic mode means that updating the textbox involves an instant update of the value displayed on the screen. If the textbox remains empty, the value displayed will be the default one, usually the message arrival timestamp for generic nodes. The features just discussed are accessible via a dropdown UI specific to each node, which can be activated via the respective debug button on the node.
For the purposes of extending the graph, please note that it stores and takes into account only the last 10 messages received, and NOT the complete history since the activation of the flow.
To USE Snap4City Proc.Logic with Debug Option based on extended Cauldron please ask to mailto:Snap4City@disit.org
We suggest to use those debug versions only for debug and develop while for execution use the classic Basic and Advanced versions provided by Snap4City, since they provide higher performance in execution.
Very soon, nap4City Proc.Logic with Debug Option will be provided to all users on Snap4City.org ONLY.