City.Risks portal and APIproject.cityrisks.eu/wp-content/uploads/2017/08/D4.2.pdfto consume REST...

9
Deliverable D4.2 City.Risks portal and API Editor N. Bakalos (ICCS) Contributors V. Hadjipanos (ICCS) Version 1.0 Date April 25, 2016 Distribution PUBLIC (PU) Ref. Ares(2017)2801267 - 05/06/2017

Transcript of City.Risks portal and APIproject.cityrisks.eu/wp-content/uploads/2017/08/D4.2.pdfto consume REST...

Page 1: City.Risks portal and APIproject.cityrisks.eu/wp-content/uploads/2017/08/D4.2.pdfto consume REST APIs. Coupled with the AngularJS the portal was developed using Boostrap 3, and a number

Deliverable D4.2

City.Risks portal and API

Editor N. Bakalos (ICCS)

Contributors V. Hadjipanos (ICCS)

Version 1.0

Date April 25, 2016

Distribution PUBLIC (PU)

Ref. Ares(2017)2801267 - 05/06/2017

Page 2: City.Risks portal and APIproject.cityrisks.eu/wp-content/uploads/2017/08/D4.2.pdfto consume REST APIs. Coupled with the AngularJS the portal was developed using Boostrap 3, and a number

City.Risks Deliverable D4.2

© City.Risks Consortium 2

Executive Summary

This report describes all the parts of the City.Risks Portal and the Interoperability API of City.Risks.

The City.Risks portal is one of the main clients of the City.Risks platform. It allows the citizen to interact with the City.Risks portal, digest data and use a number of services, namely:

1. Being informed about current incidents on their area 2. Interact with their registered devices and sensors 3. Report theft of a City.Risk Sensor 4. Use the City.Risks safe routing service 5. Receive historical and other data for City.Risks covered areas such as

a. Safe Points of Interest (e.g Police Departments, Hospitals, Embassies) b. Historical data for City.Risks covered areas (types of crime, number of

incidents).

The interoperability API is a tool provided by the project, that gives the ability to third-parties to access and query the stored data of the City.Risks platform.

Page 3: City.Risks portal and APIproject.cityrisks.eu/wp-content/uploads/2017/08/D4.2.pdfto consume REST APIs. Coupled with the AngularJS the portal was developed using Boostrap 3, and a number

City.Risks Deliverable D4.2

© City.Risks Consortium 3

Table of Contents

1. CITY.RISKS PORTAL ........................................................................................ 4

Technologies Used .............................................................................................. 4

Sitemap ............................................................................................................... 5

1.2.1. Incidents Reporting ................................................................................................. 5

1.2.2. Places ...................................................................................................................... 6

Routing ................................................................................................................ 7

2. INTEROPERABILITY API ................................................................................... 8

LIST OF ACRONYMS ........................................................................................... 9

Page 4: City.Risks portal and APIproject.cityrisks.eu/wp-content/uploads/2017/08/D4.2.pdfto consume REST APIs. Coupled with the AngularJS the portal was developed using Boostrap 3, and a number

City.Risks Deliverable D4.2

© City.Risks Consortium

4

1. City.Risks portal

City.Risks1 aims at providing citizens the ability to participate and keep informed for better addressing security challenges in urban areas, through the use of ICT infrastructures and technologies. Thus by using the effect of participatory urbanism, we aim at increasing the sense of security of citizens.

One of the main interfaces to interact with the services of City.Risks, is the City.Risks Portal.

The portal is deployed in the domain

http://portal.cityrisks.eu

The source code produced is located in the Gitlab installed for this purpose at

http://optical01.telecom.ece.ntua.gr

Technologies Used

City.Risks is built using Angular JS2, a JavaScript-based open-source front-end web application framework, officially supported by Google. Angular was selected for the framework’s ability to support single-page applications (web-apps) as well as its ability to consume REST APIs.

Coupled with the AngularJS the portal was developed using Boostrap 3, and a number of libraries mainly:

1. Angular-Translate which provides multi-language support to the portal by asynchronous loading of i18n data. The portal will support English, Greek, Italian and Bulgarian.

2. Angular-HAL, a library for easily traversing HAL JSON APIs, such as the one provided by the City.Risks core platform

3. Angular-UI-router and Angular-UI-Bootstrap for state handling 4. OpenLayers for map visualisation

1 Funded by the European Commission, in the frame of the H2020 project City.Risks, under Grant Agreement no. 653747.

2 https://angularjs.org/

Page 5: City.Risks portal and APIproject.cityrisks.eu/wp-content/uploads/2017/08/D4.2.pdfto consume REST APIs. Coupled with the AngularJS the portal was developed using Boostrap 3, and a number

City.Risks Deliverable D4.2

© City.Risks Consortium 5

Sitemap

The portal offers services through single-page applications developed as modules.

The main components of the portal are:

1. Incidents Reporting – Newsfeed (Homepage) 2. Device Handling 3. The City.Risks Places Section 4. Routing

1.2.1. Incidents Reporting

In this page the user is able to stay informed about the reported incidents in an area of his/her interest.

Figure 1: City.Risks Newsfeed (Incidents)

Page 6: City.Risks portal and APIproject.cityrisks.eu/wp-content/uploads/2017/08/D4.2.pdfto consume REST APIs. Coupled with the AngularJS the portal was developed using Boostrap 3, and a number

City.Risks Deliverable D4.2

© City.Risks Consortium 6

1.2.2. Places

Here the citizen will be able to see historical and other useful data about City.Risks Covered Areas.

The user is able to see incidents reported in an area over a particular time window.

Figure 2: Drug Related Incidents around St. James Park London - March 2015

The User also has the ability to find Points of Safety around his/her area. This service is targeted for the “tourist” user. It provides the ability to find places around you where you would feel safe. These places include:

• Hospitals

• Police Stations

• Pharmacies

• Embassies/Consulates

Page 7: City.Risks portal and APIproject.cityrisks.eu/wp-content/uploads/2017/08/D4.2.pdfto consume REST APIs. Coupled with the AngularJS the portal was developed using Boostrap 3, and a number

City.Risks Deliverable D4.2

© City.Risks Consortium 7

Figure 3: Safe Points around Bloomsbury, London WC1E 7HU, UK

The Places service also allows the citizen to view demographics, and other statistics.

Routing

The citizen here is able to use the safe-routing service of City.Risks to move around. The route is predicted by utilising historical data as well as social media data to go through places that are popular and where people gather usually.

Figure 4: Safe route from Buckingham Palace to the Tower of London

Page 8: City.Risks portal and APIproject.cityrisks.eu/wp-content/uploads/2017/08/D4.2.pdfto consume REST APIs. Coupled with the AngularJS the portal was developed using Boostrap 3, and a number

City.Risks Deliverable D4.2

© City.Risks Consortium 8

2. Interoperability API

The source code for the interoperability API for City.Risks is located at

http://optical01.telecom.ece.ntua.gr

It is a REST API built over Spring using the Java programming language.

It is an API aimed at Server-to-Server communications and allows third party applications or other remote instances of City.Risks to communicate with the core platform and query data.

The API is designed to receive calls from a known set of servers that include third party applications, that the City.Risks consortium has accepted collaboration with, or different instances of the City.Risks core platform.

Especially, for facilitating data exchange between different City.Risks Core instances, the service allows the user to sign in to the native core platform with and receive all the data from the instance that he is using. This allows the core platform to provide services to “tourist” users, meaning giving access to the back-end services of one City.Risks covered city, to users that have registered and to another instance of the platform, in a different City.Risks domain.

It allows find and GET users from the platform as well as to Get, Create, Update or Delete sensors from the core platform. The interaction with the database is by executing HTTP requests over specified URLs.

Page 9: City.Risks portal and APIproject.cityrisks.eu/wp-content/uploads/2017/08/D4.2.pdfto consume REST APIs. Coupled with the AngularJS the portal was developed using Boostrap 3, and a number

City.Risks Deliverable D4.2

© City.Risks Consortium 9

List of Acronyms

Acronym Explanation

API Application Programming Interface

DOM Document Object Model

HAL Hypertext Application Language

HTTP HyperText Transfer Protocol

JSON JavaScript Object Notation

REST Representational State Transfer

URL Uniform Resource Locator