How to Dev - Exploit Data Analytics (Python and/or Rstudio) from Proc.Logic/Node-RED

×

Warning message

  • You can't delete this newsletter because it has not been sent to all its subscribers.
  • You can't delete this newsletter because it has not been sent to all its subscribers.

 

How to proceed: In Snap4City, this activity is strongly simplified since the Data Analytic can

  • Develop the Data Analytic on local computer/workstations or on servers by using Python or Rstudio:
    • Snap4City.org provides an online development user interface for Python (Jupiter Hub) and R (RStudio Server).
    • From developed R/PY code you can directly access to Data from Storage performing REST Call API queries may be using some credential or access token to be authorized.
    • From developed R/PY code you can directly send data into Storage sending them as Entity Instances and related Entity Messages (IoT Device messages) into one of the references Brokers at disposal.
    • See example: https://www.snap4city.org/645
    • Python usage of API: https://www.snap4city.org/829
    • see also in the following the section on authentication and a section on Python access to API
  • load Python or Rstudio on MicroService Node into Processing Logic (IoT App) to see them converted / deployed in Container on Cloud.

  • Use the Processing Logic (IoT App) to pass parameters to Python or Rstudio processes of Data Analytics and get results back into the Processing Logic (IoT App) in JSON, or get errors into the Processing Logic (IoT App) also in JSON.
    • Please note that the Python and Rstudio processes in Container can directly access to the Smart City API. So that if they are designed in parametric manner (for example to work on the basis of data collected from a set of SURI, and in a time interval and these parameters are passed in the JSON input), the Data analytic node would be capable to provide Data Analytics as a Services on different data every time and automatically collecting the data (even big data amount) via a direct call of the Smart City API, using access token as described in the sequel. 
  • The user can also develop some Special Tools for implementing specific solutions providing their own visual interface, which may be included into dashboards as an External Service providing an HTTP URL.

 

In the following there is a code example in Python.

In Snap4City, there is a specific tutorial for the Data Analytic development with several examples: https://www.snap4city.org/download/video/course/da/

 

 

How to Dev - Exploit Data Analytics (Python and/or Rstudio) from Proc.Logic/Node-RED | Snap4City

Error

×

Error message

  • Unable to send e-mail. Contact the site administrator if the problem persists.
  • Unable to send e-mail. Contact the site administrator if the problem persists.
  • Unable to send e-mail. Contact the site administrator if the problem persists.
  • Unable to send e-mail. Contact the site administrator if the problem persists.
  • Notice: Trying to get property of non-object in user_is_logged_in() (line 1576 of /var/www/html/drupal/modules/user/user.module).
  • Notice: Trying to get property of non-object in user_is_logged_in() (line 1576 of /var/www/html/drupal/modules/user/user.module).
  • Notice: Trying to get property of non-object in og_field_access() (line 578 of /var/www/html/drupal/sites/default/modules/og/og.module).
  • Notice: Trying to get property of non-object in user_access() (line 806 of /var/www/html/drupal/modules/user/user.module).
  • Notice: Trying to get property of non-object in user_access() (line 818 of /var/www/html/drupal/modules/user/user.module).
  • Notice: Trying to get property of non-object in user_access() (line 819 of /var/www/html/drupal/modules/user/user.module).
  • Notice: Trying to get property of non-object in user_access() (line 825 of /var/www/html/drupal/modules/user/user.module).
  • Notice: Trying to get property of non-object in user_access() (line 828 of /var/www/html/drupal/modules/user/user.module).
  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/drupal/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/drupal/includes/bootstrap.inc).
  • Error: __clone method called on non-object in og_user_access_entity() (line 2249 of /var/www/html/drupal/sites/default/modules/og/og.module).
The website encountered an unexpected error. Please try again later.