@@ -49,8 +49,8 @@ impl BindEvalExpr for EvalGraphMatch {
49
49
mod tests {
50
50
use crate :: eval:: expr:: { BindEvalExpr , EvalGlobalVarRef , EvalGraphMatch } ;
51
51
use crate :: eval:: graph:: plan:: {
52
- BindSpec , DirectionFilter , EdgeFilter , LabelFilter , NodeFilter , NodeMatch , PathMatch ,
53
- PathPatternMatch , StepFilter , TripleFilter , ValueFilter ,
52
+ BindSpec , DirectionFilter , EdgeFilter , LabelFilter , NodeFilter , NodeMatch ,
53
+ PathPatternMatch , TripleFilter , TripleStepFilter , TripleStepMatch , ValueFilter ,
54
54
} ;
55
55
use crate :: eval:: graph:: string_graph:: StringGraphTypes ;
56
56
use crate :: eval:: graph:: types:: GraphTypes ;
@@ -62,8 +62,8 @@ mod tests {
62
62
use partiql_value:: datum:: DatumTupleRef ;
63
63
use partiql_value:: { tuple, BindingsName , DateTime , Value } ;
64
64
65
- impl < GT : GraphTypes > From < PathMatch < GT > > for PathPatternMatch < GT > {
66
- fn from ( value : PathMatch < GT > ) -> Self {
65
+ impl < GT : GraphTypes > From < TripleStepMatch < GT > > for PathPatternMatch < GT > {
66
+ fn from ( value : TripleStepMatch < GT > ) -> Self {
67
67
Self :: Match ( value)
68
68
}
69
69
}
@@ -189,7 +189,7 @@ mod tests {
189
189
BindSpec ( "e" . to_string ( ) ) ,
190
190
BindSpec ( fresh. node ( ) ) ,
191
191
) ;
192
- let spec = StepFilter {
192
+ let spec = TripleStepFilter {
193
193
dir : DirectionFilter :: LUR ,
194
194
triple : TripleFilter {
195
195
lhs : NodeFilter :: any ( ) ,
@@ -198,7 +198,11 @@ mod tests {
198
198
} ,
199
199
} ;
200
200
201
- let matcher: PathMatch < StringGraphTypes > = PathMatch { binders, spec } ;
201
+ let matcher: TripleStepMatch < StringGraphTypes > = TripleStepMatch {
202
+ binders,
203
+ spec,
204
+ filter : ValueFilter :: Always ,
205
+ } ;
202
206
203
207
test_graph ( matcher. into ( ) , "<< >>" )
204
208
}
@@ -210,10 +214,10 @@ mod tests {
210
214
// Query: (graph MATCH (:foo) -[]- ())
211
215
let binders = (
212
216
BindSpec ( fresh. node ( ) ) ,
213
- BindSpec ( fresh. node ( ) ) ,
217
+ BindSpec ( fresh. edge ( ) ) ,
214
218
BindSpec ( fresh. node ( ) ) ,
215
219
) ;
216
- let spec = StepFilter {
220
+ let spec = TripleStepFilter {
217
221
dir : DirectionFilter :: LUR ,
218
222
triple : TripleFilter {
219
223
lhs : NodeFilter :: labeled ( "foo" . to_string ( ) ) ,
@@ -222,7 +226,11 @@ mod tests {
222
226
} ,
223
227
} ;
224
228
225
- let matcher: PathMatch < StringGraphTypes > = PathMatch { binders, spec } ;
229
+ let matcher: TripleStepMatch < StringGraphTypes > = TripleStepMatch {
230
+ binders,
231
+ spec,
232
+ filter : ValueFilter :: Always ,
233
+ } ;
226
234
227
235
test_graph ( matcher. into ( ) , "<< >>" )
228
236
}
@@ -235,7 +243,7 @@ mod tests {
235
243
BindSpec ( "z" . to_string ( ) ) ,
236
244
BindSpec ( "y" . to_string ( ) ) ,
237
245
) ;
238
- let spec = StepFilter {
246
+ let spec = TripleStepFilter {
239
247
dir : DirectionFilter :: L ,
240
248
triple : TripleFilter {
241
249
lhs : NodeFilter :: any ( ) ,
@@ -244,7 +252,11 @@ mod tests {
244
252
} ,
245
253
} ;
246
254
247
- let matcher: PathMatch < StringGraphTypes > = PathMatch { binders, spec } ;
255
+ let matcher: TripleStepMatch < StringGraphTypes > = TripleStepMatch {
256
+ binders,
257
+ spec,
258
+ filter : ValueFilter :: Always ,
259
+ } ;
248
260
249
261
test_graph ( matcher. into ( ) , "<< {'x': 2, 'z': 1.2, 'y': 1} >>" )
250
262
}
@@ -259,7 +271,7 @@ mod tests {
259
271
BindSpec ( fresh. edge ( ) ) ,
260
272
BindSpec ( fresh. node ( ) ) ,
261
273
) ;
262
- let spec = StepFilter {
274
+ let spec = TripleStepFilter {
263
275
dir : DirectionFilter :: R ,
264
276
triple : TripleFilter {
265
277
lhs : NodeFilter :: any ( ) ,
@@ -268,7 +280,11 @@ mod tests {
268
280
} ,
269
281
} ;
270
282
271
- let matcher: PathMatch < StringGraphTypes > = PathMatch { binders, spec } ;
283
+ let matcher: TripleStepMatch < StringGraphTypes > = TripleStepMatch {
284
+ binders,
285
+ spec,
286
+ filter : ValueFilter :: Always ,
287
+ } ;
272
288
273
289
test_graph ( matcher. into ( ) , "<< { }, { } >>" )
274
290
}
@@ -283,7 +299,7 @@ mod tests {
283
299
BindSpec ( "z" . to_string ( ) ) ,
284
300
BindSpec ( fresh. node ( ) ) ,
285
301
) ;
286
- let spec = StepFilter {
302
+ let spec = TripleStepFilter {
287
303
dir : DirectionFilter :: LR ,
288
304
triple : TripleFilter {
289
305
lhs : NodeFilter :: any ( ) ,
@@ -292,7 +308,11 @@ mod tests {
292
308
} ,
293
309
} ;
294
310
295
- let matcher: PathMatch < StringGraphTypes > = PathMatch { binders, spec } ;
311
+ let matcher: TripleStepMatch < StringGraphTypes > = TripleStepMatch {
312
+ binders,
313
+ spec,
314
+ filter : ValueFilter :: Always ,
315
+ } ;
296
316
297
317
test_graph (
298
318
matcher. into ( ) ,
@@ -308,35 +328,46 @@ mod tests {
308
328
BindSpec ( "z1" . to_string ( ) ) ,
309
329
BindSpec ( "y1" . to_string ( ) ) ,
310
330
) ;
311
- let spec = StepFilter {
331
+ let spec = TripleStepFilter {
312
332
dir : DirectionFilter :: LUR ,
313
333
triple : TripleFilter {
314
334
lhs : NodeFilter :: labeled ( "b" . to_string ( ) ) ,
315
335
e : EdgeFilter :: any ( ) ,
316
336
rhs : NodeFilter :: labeled ( "a" . to_string ( ) ) ,
317
337
} ,
318
338
} ;
319
- let matcher1: PathMatch < StringGraphTypes > = PathMatch { binders, spec } ;
339
+ let matcher1: TripleStepMatch < StringGraphTypes > = TripleStepMatch {
340
+ binders,
341
+ spec,
342
+ filter : Default :: default ( ) ,
343
+ } ;
320
344
321
345
let binders = (
322
346
BindSpec ( "y1" . to_string ( ) ) ,
323
347
BindSpec ( "z2" . to_string ( ) ) ,
324
348
BindSpec ( "y2" . to_string ( ) ) ,
325
349
) ;
326
- let spec = StepFilter {
350
+ let spec = TripleStepFilter {
327
351
dir : DirectionFilter :: LUR ,
328
352
triple : TripleFilter {
329
353
lhs : NodeFilter :: labeled ( "a" . to_string ( ) ) ,
330
354
e : EdgeFilter :: any ( ) ,
331
355
rhs : NodeFilter :: labeled ( "b" . to_string ( ) ) ,
332
356
} ,
333
357
} ;
334
- let matcher2: PathMatch < StringGraphTypes > = PathMatch { binders, spec } ;
358
+ let matcher2: TripleStepMatch < StringGraphTypes > = TripleStepMatch {
359
+ binders,
360
+ spec,
361
+ filter : Default :: default ( ) ,
362
+ } ;
335
363
336
- let pattern_match = PathPatternMatch :: Concat ( vec ! [
337
- PathPatternMatch :: Match ( matcher1) ,
338
- PathPatternMatch :: Match ( matcher2) ,
339
- ] ) ;
364
+ let pattern_match = PathPatternMatch :: Concat (
365
+ vec ! [
366
+ PathPatternMatch :: Match ( matcher1) ,
367
+ PathPatternMatch :: Match ( matcher2) ,
368
+ ] ,
369
+ Default :: default ( ) ,
370
+ ) ;
340
371
341
372
test_graph (
342
373
pattern_match,
@@ -354,35 +385,46 @@ mod tests {
354
385
BindSpec ( fresh. edge ( ) ) ,
355
386
BindSpec ( "x2" . to_string ( ) ) ,
356
387
) ;
357
- let spec = StepFilter {
388
+ let spec = TripleStepFilter {
358
389
dir : DirectionFilter :: LUR ,
359
390
triple : TripleFilter {
360
391
lhs : NodeFilter :: any ( ) ,
361
392
e : EdgeFilter :: any ( ) ,
362
393
rhs : NodeFilter :: any ( ) ,
363
394
} ,
364
395
} ;
365
- let matcher1: PathMatch < StringGraphTypes > = PathMatch { binders, spec } ;
396
+ let matcher1: TripleStepMatch < StringGraphTypes > = TripleStepMatch {
397
+ binders,
398
+ spec,
399
+ filter : Default :: default ( ) ,
400
+ } ;
366
401
367
402
let binders = (
368
403
BindSpec ( "x2" . to_string ( ) ) ,
369
404
BindSpec ( fresh. edge ( ) ) ,
370
405
BindSpec ( "x1" . to_string ( ) ) ,
371
406
) ;
372
- let spec = StepFilter {
407
+ let spec = TripleStepFilter {
373
408
dir : DirectionFilter :: LUR ,
374
409
triple : TripleFilter {
375
410
lhs : NodeFilter :: any ( ) ,
376
411
e : EdgeFilter :: any ( ) ,
377
412
rhs : NodeFilter :: any ( ) ,
378
413
} ,
379
414
} ;
380
- let matcher2: PathMatch < StringGraphTypes > = PathMatch { binders, spec } ;
415
+ let matcher2: TripleStepMatch < StringGraphTypes > = TripleStepMatch {
416
+ binders,
417
+ spec,
418
+ filter : Default :: default ( ) ,
419
+ } ;
381
420
382
- let pattern_match = PathPatternMatch :: Concat ( vec ! [
383
- PathPatternMatch :: Match ( matcher1) ,
384
- PathPatternMatch :: Match ( matcher2) ,
385
- ] ) ;
421
+ let pattern_match = PathPatternMatch :: Concat (
422
+ vec ! [
423
+ PathPatternMatch :: Match ( matcher1) ,
424
+ PathPatternMatch :: Match ( matcher2) ,
425
+ ] ,
426
+ Default :: default ( ) ,
427
+ ) ;
386
428
test_graph (
387
429
pattern_match,
388
430
"<< { 'x1': 3, 'x2': 3 }, \
0 commit comments