-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.txt
executable file
·141 lines (79 loc) · 3.13 KB
/
README.txt
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
*************
Collustra Setup
*************
TBD
*************
CSPARQL Setup
*************
------------ Foursquare IsIn example ------------
Example that checks who is in each room using “Foursquare” check-in actions
1 - Stream registration:
PUT http://localhost:8175/streams/http%3A%2F%2Fex.org%2Ffs
2 - Query registration
PUT http://localhost:8175/queries/IsInFs
HTTP PUT body parameter:
REGISTER STREAM IsInFs AS
PREFIX : <http://streamreasoning.org/ontologies/sr4ld2013-onto#>
CONSTRUCT { ?person :isIn ?room }
FROM STREAM <http://ex.org/fs> [RANGE 1m STEP 10s]
WHERE { ?person :posts [ :who ?person ; :where ?room ] .
}
3 - Observer Registration for previous query
POST http://localhost:8175/queries/IsInFs
HTTP POST body parameter:
http://localhost:8177/http2sysout
4 - Feed the previous stream
POST http://localhost:8175/streams/http%3A%2F%2Fex.org%2Ffs
HTTP POST body parameter:
@prefix : <http://streamreasoning.org/ontologies/sr4ld2013-onto#> .
:Bob :posts [ :who :Bob ; :where :BlueRoom ] .
------------ Facebook IsWith exercise ------------
Example that checks who is together using “Facebook” post
1 - Stream registration:
PUT http://localhost:8175/streams/http%3A%2F%2Fex.org%2Ffb
2 - Query registration
PUT http://localhost:8175/queries/isWithFb
HTTP PUT body parameter:
REGISTER STREAM isWithFb AS
PREFIX : <http://streamreasoning.org/ontologies/sr4ld2013-onto#>
CONSTRUCT { ?person1 :isWith ?person }
FROM STREAM <http://ex.org/fb> [RANGE 1m STEP 10s]
WHERE { ?person1 :posts [ :who ?person1, ?person ] .
FILTER (?person1!=?person)
}
3 - Observer Registration for previous query
POST http://localhost:8175/queries/isWithFb
HTTP POST body parameter:
http://localhost:8176/http2sysout
4 - Feed the previuos stream
POST http://localhost:8175/streams/http%3A%2F%2Fex.org%2Ffb
HTTP POST body parameter:
@prefix : <http://streamreasoning.org/ontologies/sr4ld2013-onto#> .
:Carl :posts [ :who :Carl , :Bob ] .
------------ IsInWith example ------------
Example that checks who are in each room together using the stream produced by previous queries
1 - Query registration
PUT http://localhost:8175/queries/isInWithQuery
HTTP PUT body parameter:
REGISTER STREAM isInWithQuery AS
PREFIX : <http://streamreasoning.org/ontologies/sr4ld2013-onto#>
CONSTRUCT { ?person :isIn ?room }
FROM STREAM <http://localhost:8175/streams/IsInFs> [RANGE 1m STEP 10s]
FROM STREAM <http://localhost:8175/streams/isWithFb> [RANGE 1m STEP 10s]
WHERE { { ?person :isWith ?person1 .
?person1 :isIn ?room .
FILTER (?person1!=?person) }
}
2 - Observer Rregistration for previous query
POST http://localhost:8175/queries/isWithFb
HTTP POST body parameter:
http://localhost:8177/http2sysout
3 - Feed the previuos streams
POST http://localhost:8175/streams/http%3A%2F%2Fex.org%2Ffs
HTTP POST body parameter:
@prefix : <http://streamreasoning.org/ontologies/sr4ld2013-onto#> .
:Bob :posts [ :who :Bob ; :where :BlueRoom ] .
POST http://localhost:8175/streams/http%3A%2F%2Fex.org%2Ffb
HTTP POST body parameter:
@prefix : <http://streamreasoning.org/ontologies/sr4ld2013-onto#> .
:Carl :posts [ :who :Carl , :Bob ] .