@@ -106,6 +106,13 @@ curl --location --request PATCH 'http://localhost:1026/ngsi-ld/v1/entities/urn:n
106
106
}
107
107
}'
108
108
```
109
+ Being:
110
+ - idStation: station id
111
+ - month: [ 1, 2, 3, ..., 12]
112
+ - weekday: [ 1, ..., 7] (1 ->Sunday 7->Saturday)
113
+ - time: : [ 0, ... , 23]
114
+ - predictionId: String to identify the prediction in the consuming application
115
+ - socketId: String to identify the socket with the client in the consuming application
109
116
110
117
3 ) See if the ` ResSantanderBikePrediction1 ` changes
111
118
@@ -163,131 +170,37 @@ docker compose up -d
163
170
* Example of petition made to ask for a prediction:
164
171
165
172
```
166
- curl --location --request PATCH 'http://broker-yoda.dit.upm.es /ngsi-ld/v1/entities/urn:ngsi-ld:ReqSantanderBikePrediction1/attrs' \
173
+ curl --location --request PATCH 'http://138.4.22.130 /ngsi-ld/v1/entities/urn:ngsi-ld:ReqSantanderBikePrediction1/attrs' \
167
174
--header 'Content-Type: application/json' \
168
- --data-raw '{
169
- "month":{
170
- "type":"Property",
171
- "value":9
172
- },
173
- "idStation": {
174
- "type":"Property",
175
- "value":11
176
- },
177
- "weekday":{
178
- "type":"Property",
179
- "value":2
180
- },
181
- "hour":{
182
- "type":"Property",
183
- "value":23
184
- },
185
- "predictionId":{
186
- "type":"Property",
187
- "value":"p-1662768034900"
188
- },
189
- "socketId":{
190
- "type":"Property",
191
- "value":"Fn0kKHEF-dOcr311AAAF"
192
- }
193
- }'
175
+ --data-raw '{...}'
176
+
194
177
```
195
178
196
- Being:
197
- - idStation: station id
198
- - month: [ 1, 2, 3, ..., 12]
199
- - weekday: [ 1, ..., 7] 1 ->Sunday 7->Saturday
200
- - time: : [ 0, ... , 23]
201
- - predictionId: String to identify the prediction in the consuming application
202
- - socketId: String to identify the socket with the client in the consuming application
203
179
204
180
### Testing everything worked
205
181
206
182
1 ) Validate that the subscription and entities exist:
207
183
```
208
- curl --location --request GET 'http://broker-yoda.dit.upm.es /ngsi-ld/v1/subscriptions/'
184
+ curl --location --request GET 'http://138.4.22.130 /ngsi-ld/v1/subscriptions/'
209
185
```
210
186
211
187
```
212
- curl --location --request GET 'http://broker-yoda.dit.upm.es /ngsi-ld/v1/entities/urn:ngsi-ld:ReqSantanderBikePrediction1'
188
+ curl --location --request GET 'http://138.4.22.130 /ngsi-ld/v1/entities/urn:ngsi-ld:ReqSantanderBikePrediction1'
213
189
```
214
190
215
191
```
216
- curl --location --request GET 'http://broker-yoda.dit.upm.es /ngsi-ld/v1/entities/urn:ngsi-ld:ResSantanderBikePrediction1'
192
+ curl --location --request GET 'http://138.4.22.130 /ngsi-ld/v1/entities/urn:ngsi-ld:ResSantanderBikePrediction1'
217
193
```
218
194
219
195
2 ) Update the ` ReqSantanderBikePrediction1 `
220
196
```
221
- curl --location --request PATCH 'http://broker-yoda.dit.upm.es /ngsi-ld/v1/entities/urn:ngsi-ld:ReqSantanderBikePrediction1/attrs' \
197
+ curl --location --request PATCH 'http://138.4.22.130 /ngsi-ld/v1/entities/urn:ngsi-ld:ReqSantanderBikePrediction1/attrs' \
222
198
--header 'Content-Type: application/json' \
223
- --data-raw '{
224
- "month":{
225
- "type":"Property",
226
- "value":9
227
- },
228
- "idStation": {
229
- "type":"Property",
230
- "value":11
231
- },
232
- "weekday":{
233
- "type":"Property",
234
- "value":2
235
- },
236
- "hour":{
237
- "type":"Property",
238
- "value":23
239
- },
240
- "predictionId":{
241
- "type":"Property",
242
- "value":"p-1662768034900"
243
- },
244
- "socketId":{
245
- "type":"Property",
246
- "value":"Fn0kKHEF-dOcr311AAAF"
247
- }
248
- }'
199
+ --data-raw '{...}'
249
200
```
250
201
251
202
3 ) See if the ` ResSantanderBikePrediction1 ` changes
252
203
253
204
```
254
- curl --location --request GET 'http://broker-yoda.dit.upm.es/ngsi-ld/v1/entities/urn:ngsi-ld:ResSantanderBikePrediction1'
255
- ```
256
-
257
- Response:
258
- ```
259
- {
260
- "@context":"https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld",
261
- "id":"urn:ngsi-ld:ResSantanderBikePrediction1",
262
- "type":"ResSantanderBikePrediction",
263
- "socketId":{
264
- "type":"Property",
265
- "value":"Fn0kKHEF-dOcr311AAAF"
266
- },
267
- "predictionId":{
268
- "type":"Property",
269
- "value":"p-1662768034900"
270
- },
271
- "predictionValue":{
272
- "type":"Property",
273
- "value":15
274
- },
275
- "idStation":{
276
- "type":"Property",
277
- "value":"11"
278
- },
279
- "weekday":{
280
- "type":"Property",
281
- "value":2
282
- },
283
- "hour":{
284
- "type":"Property",
285
- "value":22
286
- },
287
- "month":{
288
- "type":"Property",
289
- "value":9
290
- }
205
+ curl --location --request GET 'http://138.4.22.130/ngsi-ld/v1/entities/urn:ngsi-ld:ResSantanderBikePrediction1'
291
206
```
292
- Result of prediction: 15 bikes available
293
- - predictionValue: number of bikes available
0 commit comments