-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapiary.apib
More file actions
290 lines (197 loc) · 6.82 KB
/
Copy pathapiary.apib
File metadata and controls
290 lines (197 loc) · 6.82 KB
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
289
290
FORMAT: 1A
HOST: http://rsp.streamreasoning.org/api
# RSP API
APIs allowing consumers to interact with RDF Stream processors.
## Engine Collection [/engine]
### Status [GET]
+ Response 200 (application/json)
{
"name": "csparql",
"host": "csparql/",
"port": 8182,
"empty_results": false,
"inference": false,
"timestamfunction": false,
"backloop": true
}
## Datasets Collection [/datasets]
### List All Datasets [GET]
+ Response 200 (application/json)
[
{
"iri": "https://streamreasoning.org/ds1.rdf",
"isDefault": false,
"name": "ds1",
"serialization": "RDF/XML",
"status": "STATIC"
},
{
"iri": "https://streamreasoning.org/ds2.rdf",
"isDefault": true,
"name": "ds2",
"serialization": "JSON-LD",
"status": "STATIC"
}
]
## Datasets [/datasets/{dataset}]
### Retrieve a Datasets [GET]
+ Request
+ Parameters
+ dataset (required, string, `str1`) ... String `name` of the Datasets.
+ Response 200 (application/json)
{
"iri": "https://streamreasoning.org/SensorRepository.rdf",
"isDefault": false,
"name": "SensorRepository",
"serialization": "RDF/XML",
"status": "STATIC"
}
### Register a Dataset [POST]
+ Request (application/x-www-form-urlencoded)
+ Parameters
+ dataset (required, string) ... String `name` of the Dataset.
+ Body
+ location: `https://streamreasoning.org/SensorRepository.rdf`)
+ name: (string, `SensorRepository`) ... internal name of the dataset.
+ serialization: (string, `RDF/XML`) ... serialization of the dataset.
+ default: (boolean, 'false') ... specifies if the dataset should be considered as default in queries
+ Response 200 (application/json)
+ Body
"Dataset SensorRepository succesfully registered with IRI https://streamreasoning.org/SensorRepository.rdf"
### Delete a Dataset [DELETE]
+ Request
+ Parameters
+ dataset (required, string, `str1`) ... String `name` of the Datasets.
+ Response 200 (application/json)
+ Body
"Dataset SensorRepository succesfully unregistered"
## Stream Collection [/streams]
### List All Streams [GET]
+ Response 200 (application/json)
[
{
"streamURL": "str2",
"status": "RUNNING"
},
{
"streamURL": "str1",
"status": "RUNNING"
}
]
## Streams [/streams/{stream}]
### Retrieve a Stream [GET]
+ Request
+ Parameters
+ stream (required, string, `str1`) ... String `name` of the Stream.
+ Response 200 (application/json)
{
"streamURL": "str2",
"status": "RUNNING"
}
### Register a Stream [POST]
+ Request (application/x-www-form-urlencoded)
+ Parameters
+ stream (required, string) ... String `name` of the Stream.
+ Body
streamIri: (uri, `http://192.168.99.100:4000/sgraph`) ... Location URI of the Stream.
+ Response 200 (application/json)
+ Body
"Stream str1 succesfully registered with IRI http://192.168.99.100:4000/sgraph"
### Delete a Stream [DELETE]
+ Request
+ Parameters
+ stream (required, string, `str1`) ... String `name` of the stream.
+ Response 200 (application/json)
+ Body
"stream name succesfully unregistered"
## Query Collection [/queries]
### List All queries [GET]
+ Request
+ Parameters
+ query (required, string, `query1`) String name of the query
+ Response 200 (application/json)
[
{
"id": "query2",
"type": "STREAM",
"status": "RUNNING"
},
{
"id": "query1",
"type": "STREAM",
"status": "RUNNING"
}
]
## Queries [/queries/{query}]
### Retrieve a queries [GET]
+ Request
+ Parameters
+ query (required, string, `query1`) ... String `name` of the Stream.
+ Response 200 (application/json)
{
"id": "query1",
"type": "STREAM",
"streams": [
"str1"
],
"body": "REGISTER STREAM query1 AS CONSTRUCT {?s ?p ?o} FROM STREAM <str1> [RANGE 1m STEP 1m] WHERE {?s ?p ?o}",
"status": "RUNNING"
}
### Register a Query [POST]
+ Request
+ Parameters
+ query (required, string, `query1`) String name of the query
+ Body
queryBody: REGISTER STREAM query1 AS CONSTRUCT {?s ?p ?o} FROM STREAM <str1> [RANGE 1m STEP 1m] WHERE {?s ?p ?o}
+ Response 200 (application/x-www-form-urlencoded)
"Query query1 succesfully registered"
### Unregister a Query [DELETE]
+ {TODO}
## Observers Collection [/queries/{query}/observers]
### List Observers of a Query [GET]
+ Request
+ Parameters
+ query (required, string, `query1`) ... String `name` of the Query.
+ Response 200 (application/json)
[
{
"id": "observer2",
"url": "ws://localhost:8282/query1"
},
{
"id": "observer1",
"url": "ws://localhost:8282/query1"
}
]
## Observers [/queries/{query}/observers/{observer}]
### Retrieve a Query's Observer[GET]
+ Request
+ Parameters
+ query (required, string, `query1`) ... String `name` of the Query.
+ observer (required, string, `obs1`) ... String `name` of the Observer.
+ Response 200 (application/json)
{
"id": "query1-observer1",
"queryName": "query1",
"url": "ws://localhost:8282/query1",
"observer": {
"sendEmptyResults": true,
"host": "localhost",
"port": 8282,
"path": "/query1",
"dataPath": "ws://localhost:8282/query1/results"
}
}
### Register an Observer to a Query [POST]
+ Request
+ Parameters
+ query (required, string, `query1`) ... String `name` of the Query.
+ observer (required, string, `obs1`) ... String `name` of the Observer.
+ Body
+ type (optional, string, `ws`) ... The type of the observer (websocket or pull)
+ host (optional, string, `localhost`) ... The address of the websocket observer
+ port (optional, integer, `9999`) ... The port of the websocket observer
+ Response 200 (application/x-www-form-urlencoded)
"http://localhost:8181/queries/query1/observers/{query}-{observer}"
### Remove an Observer from a Query [DELETE]
+ {TODO}