-
Notifications
You must be signed in to change notification settings - Fork 2
/
swagger.yaml
288 lines (288 loc) · 10.1 KB
/
swagger.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
swagger: "2.0"
info:
title: LCI Context Aware Recommendation SE
description: REST APIs for both Context Aware Recommendation modules - Activity and Context Recognition module and Recommendation Matrix Preparation module.
version: 1.0.0
contact:
name: REST API Support
email: "milenko.tosic@lacitadelleing.com"
host: "89.216.30.67:8080"
schemes:
- http
basePath: /
produces:
- application/json
paths:
/recommend/:
get:
produces:
- application/json
summary: Return POI recommendation
description: "Sends recommendation request from mobile application to the Recommendation Matrix Preparation server module. This SE module returns recommended POIs and actions based on user's context and activity.\n"
parameters:
- name: uuid
in: query
description: User id based on Cordova plug-in org.apache.cordova.device 0.2.10 “Device”
required: true
type: string
- name: lat
in: query
description: Latitude component of user location.
required: true
type: number
format: double
- name: lon
in: query
description: Longitude component of user location.
required: true
type: number
format: double
- name: ts
in: query
description: Current time on user device in miliseconds.
required: true
type: number
format: double
- name: ac
in: query
description: Specifies recommendation type (0-(default) recommendation based only on the current location; 1-recommendation based on the current activity; 2-recommendation based on the current temporal and spatial context; 3-recommendation based on the current activity and temporal/spatial context)
required: false
type: integer
format: int32
- name: poi_num
in: query
description: Number of POIs to be returned from the recommender module (default = 5).
required: false
type: integer
format: int32
- name: ignore
in: query
description: Indication that user is not interested in the recommended POI (value=poi_id).
required: false
type: string
tags:
- POI Recommendation
responses:
"200":
description: Array of JSON formatted POIs (in line with POI JSON format defined in POI Provider GE) provided by the recommender plus recognized acitivty and user context.
schema:
type: array
items:
$ref: "#/definitions/POI"
activity: Recognized user activity
context: Recognized user context
default:
description: Unexpected error
schema:
$ref: "#/definitions/Error"
/ac/:
post:
produces:
- application/json
summary: Sends sensory and contextual data from mobile app
description: "Enables sensory data to be sent to the Activity and Context Recognition module from mobile devices. Sensory data include acceleration, gyroscope, GPS coordinates and surrounding WiFi network SSIDs with SNR levels.\n"
parameters:
- name: uuid
in: body
description: User id based on Cordova plug-in org.apache.cordova.device 0.2.10 “Device”
required: true
type: string
- name: location
in: body
description: Current location of the user
required: true
schema:
timestamp: Current time on user device in miliseconds
$ref: "#/definitions/coordinates"
- name: acceleration
in: body
description: "Acceleration accross x, y and z axes"
required: true
schema:
type: array
items:
$ref: "#/definitions/acceleration"
- name: gyroscope
in: body
description: "Angular acceleration accross x, y and z axes"
required: true
schema:
type: array
items:
$ref: "#/definitions/gyroscope"
- name: wifi
in: body
description: SSID of surrounding WiFi networks
required: true
schema:
type: array
items:
$ref: "#/definitions/WiFi"
- name: wifi_connected
in: body
description: SSID of the WiFi network to which the end user is connected
required: true
type: string
tags:
- Sensory data
responses:
"200":
description: "Success []"
default:
description: Unexpected error
schema:
$ref: "#/definitions/Error"
get:
summary: Request for activity and context recognition
description: Request for activity/context classification with parameters for configuring the activity/context recognition module. Sent from Recommendation Matrix Preparation module to the Activity and Context Recognition module.
parameters:
- name: uuid
in: query
description: User id based on Cordova plug-in org.apache.cordova.device 0.2.10 “Device”
required: true
type: string
- name: ac
in: query
description: Choosing activity and/or context recognition (1-only activity recognition; 2-only spatial and temporal context recognition; 3-both context and activity recognition)
required: true
type: integer
format: int32
- name: alg
in: query
type: string
description: Specification of classification algorithm to be used (dt-decision tree algorithm for deterministic classification; svm-support vector machine algorithm which returns probability vector accross all activity classes)
- name: fs
in: query
type: string
description: Specification of the feature set to be used for classification (standard-standard feature set (21 features used for recognition); enhanced-full set of features (39 features used for recognition))
- name: tp
in: query
description: Period in seconds for which the activity context recognition needs to be performed (default 3 seconds).
required: false
type: number
format: double
tags:
- Request activity and context
responses:
"200":
description: Probability vector accross all activity classes or deterministic activity class with user spatial context (connected and surrounding WiFi SSIDs and direction of movement during the specified time period in tp parameter)
schema:
$ref: "#/definitions/activity_and_context"
default:
description: Unexpected error
schema:
$ref: "#/definitions/Error"
definitions:
POI:
schema:
type: string
description: Unique identifier representing a specific POI
schema:
fw_core: POI container
schema:
properties:
location:
description: Location container
schema:
wgs84: FI WARE location container
properties:
latitude:
type: number
format: double
description: Latitude component of the POI location
longitude:
type: number
format: double
description: Longitude component of the POI location
category:
type: string
description: POI category specified in Recommendation Matrix Preparation module
name:
type: string
description: POI name obtained from Foursquare service
label:
type: string
description: POI sub-category defined by Foursquare service
activity_and_context:
properties:
activity_vector:
type: array
items:
type: number
format: double
description: Array of classification probabilities accross all activity classes (walking, standing, running, sitting, laying, upstairs, downstairs)
uuid:
type: string
description: Unique user identifier used by other SE components
activity:
type: string
description: Deterministic activity class based on the last 128 sensory samples
wifi:
type: string
description: SSID of WiFi network to which the user deviceis connected
coordinates:
properties:
latitude:
type: number
format: double
description: Latitude component of the current location
longitude:
type: number
format: double
description: Longitude component of the current location
acceleration:
properties:
timestamp:
type: number
format: double
description: Current time on user device in miliseconds
x:
type: number
format: double
description: Acceleration accross x axis
"y":
type: number
format: double
description: Acceleration accross y axis
z:
type: number
format: double
description: Acceleration accross z axis
gyroscope:
properties:
timestamp:
type: number
format: double
description: Current time on user device in miliseconds
x:
type: number
format: double
description: Gyroscope x axis
"y":
type: number
format: double
description: Gyroscope y axis
z:
type: number
format: double
description: Gyroscope z axis
WiFi:
properties:
ssids:
type: array
items:
type: string
description: Gyroscope x axis
timestamp:
type: number
format: double
description: Current time on user device in miliseconds
Error:
properties:
code:
type: integer
format: int32
message:
type: string
fields:
type: string