Skip to content

Commit a5a3324

Browse files
committed
test updated with csparql2 (rsp-ql) syntax + structured
1 parent 36d778c commit a5a3324

File tree

1 file changed

+22
-7
lines changed

1 file changed

+22
-7
lines changed

src/test/resources/csparql/03_logical_window_step.smol

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1+
// reada src/test/resources/csparql/03_logical_window_step.smol
2+
13
streamer class C(Int x, Monitor<Int> m)
24

35
Unit register()
46
Monitor<Int> m = monitor("
5-
SELECT (SUM(?x) as ?sumX)
6-
FROM STREAM %1 [RANGE 5s STEP 2s]
7-
WHERE { ?s prog:C_x ?x }
7+
SELECT (SUM(?x) AS ?sumX)
8+
FROM NAMED WINDOW <win> ON %1 [RANGE PT6s STEP PT2s]
9+
WHERE {
10+
WINDOW ?w { ?s prog:C_x ?x }
11+
}
812
", this);
913
this.m = m;
1014
end
@@ -25,16 +29,27 @@ streamer class C(Int x, Monitor<Int> m)
2529
end
2630

2731
main
28-
C o = new C(0, null);
29-
o.register();
30-
32+
// configure simulation
3133
clock Int i = 100;
3234
Int endAt = 200;
3335

36+
// initialize stream
37+
C o = new C(0, null);
38+
39+
// initialize monitor
40+
o.register();
41+
42+
// run simulation
3443
while i < endAt do
44+
45+
// put triples in the stream
3546
o.doStream();
47+
48+
// read window contents
3649
String res = o.windowToString();
3750
print(">>" ++ intToString(i) ++ ": " ++ res);
51+
52+
// advance clock (timestamp)
3853
i = i + 1;
3954
end
4055
end
@@ -55,5 +70,5 @@ end
5570

5671
// Notes:
5772
// - Step 2 seconds = new window every 2 seconds
58-
// - Windows have {2, 4, 5, 5, 5, ...} elements
73+
// - Range 6s: Windows have {2, 4, 5, 5, 5, ...} elements
5974

0 commit comments

Comments
 (0)