API | SAGE

SAGE Analytics

Sewio’s latest software product SAGE Analytics is a two-part application designed to make position data analysis easier for everyone. Application is based on a web client, written in Angular 2, and a web server API created with Slim framework. Main idea behind SAGE Analytics’ design is three simple questions: “Who? Where? When?”. These three questions are pillars of every request made in SAGE Analytics. Processed data is always sent from the server and shown in the client application’s chart based interface.

Who

First step to make the data analysis more accessible, is creating unified hierarchic structure of participants and groups they belong to. This is handled by the client application in the “Categories” bookmark. Possible interactions inside of this bookmark are: creating group, deleting group, renaming group and managing group units. Server PI for these actions is described at the bottom of this document. Creating groups and adding units is done via green plus button. Groups have various effects in each metric they are selected in. These effects are described bellow for every single metric.


Where

Position of participants is the most important information in SAGE Analytics. For better orientation in space a zone system is present in Sensmap application. In the future releases of SAGE Analytics, zone system will be added as well. Zones are used to mark points of interest for selected data sets.

When

Every position data has a certain time stamp. Selecting the time interval is a crucial part of data analysis. There are predefined time periods in the client application for you to choose and user interface for creating your own intervals. Selected intervals remains active until changed.

Metrics

All possible metrics are described here.

Heatmap

Graphical representation of position density for selected units or category on a corresponding plan. Entire group selection is equal to selecting all units of the group.

 

Intensity: Strength of one position record.

Interval: Adjustable time interval of displayed results.

First appearance in zone

Table of first entrance time of selected units into selected zones. If the entire group is selected only the first entry from all of the group units is displayed.

Last appearance in zone

Table of last exit time of selected units from selected zones. If the entire group is selected only the last exit from all of the group units is displayed.

Distance

Chart showing distance traveled by selected unit in the selected time interval. If the entire group is selected the displayed value is a sum of distances traveled by all group members.

Speed

Chart showing speed of a selected unit through the selected time interval. Speed is counted as an average of intervals counted by division of entire interval by 50. If the entire group is selected the speed of all members is added to each other and the result is displayed (sum).

Activity

Chart showing amount of blinks sent by selected units from selected zones. If the entire group is selected the sum of their blink counts is displayed.

Spaghetti map

Graphical representation of selected units’ positions. Positions are connected with lines. Entire group selection is equal to selecting all units of the group.

 

Interval: Andjustable time interval of displayed results.

Attendance

Chart showing if the unit is present in the selected zone. Entire group selection shows how many units that belong into said group was present in the selected zone.

Zone map

Graphical representation of time spent by selected units in the selected zones. Times are shown after clicking on a zone of interest. Clicking on time of any unit shows it’s time decomposition between all other selected zones. Entire group selection is counting time as sum of it’s units.

Request

Creating request for server is split into several iterations. First you need to specify what data would you like to see and what period are you interested in. The server responds with all possible participants of this data set and lets you choose them. If the data have something to do with the zones, the next iteration is added. After all request options were specified the server creates corresponding data set and returns it to the client. Request interface is a subject to change in the future release.

Chart creation example

Client Request (GET):

http://server_ip/sageserver/request

Hint: This request gives you all possible metrics you can use.

Server Response:

Hint: In the JSON response you can see possible metrics you can use.

Client Request (GET):

http://server_ip/sageserver/request?type=9

Hint: Let’s choose an Attendance metric with type ID 9.

Server Response:

Hint: You may see there are 3 uncategorized units and 2 units in a group called “Team A”. Also you are allowed to choose multiple values and even values from different groups.

Client Request (GET):

http://server_ip/sageserver/request?type=9&lid=1,c1

Hint: Let’s choose whole category “Team A” and uncategorized unit with ID 1.

Server Response:

Client Request (GET):

http://server_ip/sageserver/request?type=9&lid=1,c1&rid=1

Hint: Let’s see attendance in zone called “Middle Area”.

Server Response:

Hint: The request is ready. We can create our chart now.

Client Request (POST):

http://server_ip/sageserver/chart

Request Body:

Hint: This is how we get our chart data.

Server Response:

You may try this yourself, to see what data you can get from server.

Interactive REST API Interface

Swagger UXswagger

RTLS Analytics

 1.0.0 

 

[ Base url: 192.168.225.2/sageserver]

Categories

GET/categories

POST/categories

GET/categories/{id}

PUT/categories/{id}

DELETE/categories/{id}

Requests

GET/request

Charts

POST/chart

Models

#/definitions/CategoryCategory{}
#/definitions/RequestListRequestList{}
#/definitions/RequestGroupRequestGroup{}
#/definitions/RequestRequest{}
#/definitions/ChartRequestChartRequest{}
#/definitions/ChartChart{}
#/definitions/ChartOptionsChartOptions{}
#/definitions/ChartActionsChartActions{}
#/definitions/ErrorError{}