diff options
author | 2023-04-10 19:18:29 +0200 | |
---|---|---|
committer | 2023-04-15 17:15:50 +0200 | |
commit | 7c15c0e6e6a035458bdd89a939aacdf4a207e1cd (patch) | |
tree | e9318d8f1c326c05ee981e4ec966fb3fcffd6afa /subprojects/store-query-viatra/src/test/java | |
parent | build: add workflow for REUSE compliance check (diff) | |
download | refinery-7c15c0e6e6a035458bdd89a939aacdf4a207e1cd.tar.gz refinery-7c15c0e6e6a035458bdd89a939aacdf4a207e1cd.tar.zst refinery-7c15c0e6e6a035458bdd89a939aacdf4a207e1cd.zip |
refactor: rename RelationView to SymbolView
* Add NodeFunctionView for symbols that hold function-like (single
associated object for each key) relations as integer values for performance.
Diffstat (limited to 'subprojects/store-query-viatra/src/test/java')
4 files changed, 85 insertions, 85 deletions
diff --git a/subprojects/store-query-viatra/src/test/java/tools/refinery/store/query/viatra/DiagonalQueryTest.java b/subprojects/store-query-viatra/src/test/java/tools/refinery/store/query/viatra/DiagonalQueryTest.java index da4aba7f..5cffef71 100644 --- a/subprojects/store-query-viatra/src/test/java/tools/refinery/store/query/viatra/DiagonalQueryTest.java +++ b/subprojects/store-query-viatra/src/test/java/tools/refinery/store/query/viatra/DiagonalQueryTest.java | |||
@@ -12,8 +12,8 @@ import tools.refinery.store.query.dnf.Dnf; | |||
12 | import tools.refinery.store.query.dnf.Query; | 12 | import tools.refinery.store.query.dnf.Query; |
13 | import tools.refinery.store.query.term.Variable; | 13 | import tools.refinery.store.query.term.Variable; |
14 | import tools.refinery.store.query.viatra.tests.QueryEngineTest; | 14 | import tools.refinery.store.query.viatra.tests.QueryEngineTest; |
15 | import tools.refinery.store.query.view.FunctionalRelationView; | 15 | import tools.refinery.store.query.view.FunctionView; |
16 | import tools.refinery.store.query.view.KeyOnlyRelationView; | 16 | import tools.refinery.store.query.view.KeyOnlyView; |
17 | import tools.refinery.store.representation.Symbol; | 17 | import tools.refinery.store.representation.Symbol; |
18 | import tools.refinery.store.tuple.Tuple; | 18 | import tools.refinery.store.tuple.Tuple; |
19 | 19 | ||
@@ -30,8 +30,8 @@ class DiagonalQueryTest { | |||
30 | void inputKeyNegationTest(QueryEvaluationHint hint) { | 30 | void inputKeyNegationTest(QueryEvaluationHint hint) { |
31 | var person = new Symbol<>("Person", 1, Boolean.class, false); | 31 | var person = new Symbol<>("Person", 1, Boolean.class, false); |
32 | var symbol = new Symbol<>("symbol", 4, Boolean.class, false); | 32 | var symbol = new Symbol<>("symbol", 4, Boolean.class, false); |
33 | var personView = new KeyOnlyRelationView<>(person); | 33 | var personView = new KeyOnlyView<>(person); |
34 | var symbolView = new KeyOnlyRelationView<>(symbol); | 34 | var symbolView = new KeyOnlyView<>(symbol); |
35 | 35 | ||
36 | var p1 = Variable.of("p1"); | 36 | var p1 = Variable.of("p1"); |
37 | var p2 = Variable.of("p2"); | 37 | var p2 = Variable.of("p2"); |
@@ -78,8 +78,8 @@ class DiagonalQueryTest { | |||
78 | void subQueryNegationTest(QueryEvaluationHint hint) { | 78 | void subQueryNegationTest(QueryEvaluationHint hint) { |
79 | var person = new Symbol<>("Person", 1, Boolean.class, false); | 79 | var person = new Symbol<>("Person", 1, Boolean.class, false); |
80 | var symbol = new Symbol<>("symbol", 4, Boolean.class, false); | 80 | var symbol = new Symbol<>("symbol", 4, Boolean.class, false); |
81 | var personView = new KeyOnlyRelationView<>(person); | 81 | var personView = new KeyOnlyView<>(person); |
82 | var symbolView = new KeyOnlyRelationView<>(symbol); | 82 | var symbolView = new KeyOnlyView<>(symbol); |
83 | 83 | ||
84 | var p1 = Variable.of("p1"); | 84 | var p1 = Variable.of("p1"); |
85 | var p2 = Variable.of("p2"); | 85 | var p2 = Variable.of("p2"); |
@@ -139,8 +139,8 @@ class DiagonalQueryTest { | |||
139 | void inputKeyCountTest(QueryEvaluationHint hint) { | 139 | void inputKeyCountTest(QueryEvaluationHint hint) { |
140 | var person = new Symbol<>("Person", 1, Boolean.class, false); | 140 | var person = new Symbol<>("Person", 1, Boolean.class, false); |
141 | var symbol = new Symbol<>("symbol", 4, Boolean.class, false); | 141 | var symbol = new Symbol<>("symbol", 4, Boolean.class, false); |
142 | var personView = new KeyOnlyRelationView<>(person); | 142 | var personView = new KeyOnlyView<>(person); |
143 | var symbolView = new KeyOnlyRelationView<>(symbol); | 143 | var symbolView = new KeyOnlyView<>(symbol); |
144 | 144 | ||
145 | var p1 = Variable.of("p1"); | 145 | var p1 = Variable.of("p1"); |
146 | var p2 = Variable.of("p2"); | 146 | var p2 = Variable.of("p2"); |
@@ -190,8 +190,8 @@ class DiagonalQueryTest { | |||
190 | void subQueryCountTest(QueryEvaluationHint hint) { | 190 | void subQueryCountTest(QueryEvaluationHint hint) { |
191 | var person = new Symbol<>("Person", 1, Boolean.class, false); | 191 | var person = new Symbol<>("Person", 1, Boolean.class, false); |
192 | var symbol = new Symbol<>("symbol", 4, Boolean.class, false); | 192 | var symbol = new Symbol<>("symbol", 4, Boolean.class, false); |
193 | var personView = new KeyOnlyRelationView<>(person); | 193 | var personView = new KeyOnlyView<>(person); |
194 | var symbolView = new KeyOnlyRelationView<>(symbol); | 194 | var symbolView = new KeyOnlyView<>(symbol); |
195 | 195 | ||
196 | var p1 = Variable.of("p1"); | 196 | var p1 = Variable.of("p1"); |
197 | var p2 = Variable.of("p2"); | 197 | var p2 = Variable.of("p2"); |
@@ -254,8 +254,8 @@ class DiagonalQueryTest { | |||
254 | void inputKeyAggregationTest(QueryEvaluationHint hint) { | 254 | void inputKeyAggregationTest(QueryEvaluationHint hint) { |
255 | var person = new Symbol<>("Person", 1, Boolean.class, false); | 255 | var person = new Symbol<>("Person", 1, Boolean.class, false); |
256 | var symbol = new Symbol<>("symbol", 4, Integer.class, null); | 256 | var symbol = new Symbol<>("symbol", 4, Integer.class, null); |
257 | var personView = new KeyOnlyRelationView<>(person); | 257 | var personView = new KeyOnlyView<>(person); |
258 | var symbolView = new FunctionalRelationView<>(symbol); | 258 | var symbolView = new FunctionView<>(symbol); |
259 | 259 | ||
260 | var p1 = Variable.of("p1"); | 260 | var p1 = Variable.of("p1"); |
261 | var p2 = Variable.of("p2"); | 261 | var p2 = Variable.of("p2"); |
@@ -306,8 +306,8 @@ class DiagonalQueryTest { | |||
306 | void subQueryAggregationTest(QueryEvaluationHint hint) { | 306 | void subQueryAggregationTest(QueryEvaluationHint hint) { |
307 | var person = new Symbol<>("Person", 1, Boolean.class, false); | 307 | var person = new Symbol<>("Person", 1, Boolean.class, false); |
308 | var symbol = new Symbol<>("symbol", 4, Integer.class, null); | 308 | var symbol = new Symbol<>("symbol", 4, Integer.class, null); |
309 | var personView = new KeyOnlyRelationView<>(person); | 309 | var personView = new KeyOnlyView<>(person); |
310 | var symbolView = new FunctionalRelationView<>(symbol); | 310 | var symbolView = new FunctionView<>(symbol); |
311 | 311 | ||
312 | var p1 = Variable.of("p1"); | 312 | var p1 = Variable.of("p1"); |
313 | var p2 = Variable.of("p2"); | 313 | var p2 = Variable.of("p2"); |
@@ -374,8 +374,8 @@ class DiagonalQueryTest { | |||
374 | void inputKeyTransitiveTest(QueryEvaluationHint hint) { | 374 | void inputKeyTransitiveTest(QueryEvaluationHint hint) { |
375 | var person = new Symbol<>("Person", 1, Boolean.class, false); | 375 | var person = new Symbol<>("Person", 1, Boolean.class, false); |
376 | var symbol = new Symbol<>("symbol", 2, Boolean.class, false); | 376 | var symbol = new Symbol<>("symbol", 2, Boolean.class, false); |
377 | var personView = new KeyOnlyRelationView<>(person); | 377 | var personView = new KeyOnlyView<>(person); |
378 | var symbolView = new KeyOnlyRelationView<>(symbol); | 378 | var symbolView = new KeyOnlyView<>(symbol); |
379 | 379 | ||
380 | var p1 = Variable.of("p1"); | 380 | var p1 = Variable.of("p1"); |
381 | var query = Query.builder("Diagonal") | 381 | var query = Query.builder("Diagonal") |
@@ -420,8 +420,8 @@ class DiagonalQueryTest { | |||
420 | void subQueryTransitiveTest(QueryEvaluationHint hint) { | 420 | void subQueryTransitiveTest(QueryEvaluationHint hint) { |
421 | var person = new Symbol<>("Person", 1, Boolean.class, false); | 421 | var person = new Symbol<>("Person", 1, Boolean.class, false); |
422 | var symbol = new Symbol<>("symbol", 2, Boolean.class, false); | 422 | var symbol = new Symbol<>("symbol", 2, Boolean.class, false); |
423 | var personView = new KeyOnlyRelationView<>(person); | 423 | var personView = new KeyOnlyView<>(person); |
424 | var symbolView = new KeyOnlyRelationView<>(symbol); | 424 | var symbolView = new KeyOnlyView<>(symbol); |
425 | 425 | ||
426 | var p1 = Variable.of("p1"); | 426 | var p1 = Variable.of("p1"); |
427 | var p2 = Variable.of("p2"); | 427 | var p2 = Variable.of("p2"); |
diff --git a/subprojects/store-query-viatra/src/test/java/tools/refinery/store/query/viatra/FunctionalQueryTest.java b/subprojects/store-query-viatra/src/test/java/tools/refinery/store/query/viatra/FunctionalQueryTest.java index 3af67a50..19584273 100644 --- a/subprojects/store-query-viatra/src/test/java/tools/refinery/store/query/viatra/FunctionalQueryTest.java +++ b/subprojects/store-query-viatra/src/test/java/tools/refinery/store/query/viatra/FunctionalQueryTest.java | |||
@@ -13,9 +13,9 @@ import tools.refinery.store.query.dnf.Dnf; | |||
13 | import tools.refinery.store.query.dnf.Query; | 13 | import tools.refinery.store.query.dnf.Query; |
14 | import tools.refinery.store.query.term.Variable; | 14 | import tools.refinery.store.query.term.Variable; |
15 | import tools.refinery.store.query.viatra.tests.QueryEngineTest; | 15 | import tools.refinery.store.query.viatra.tests.QueryEngineTest; |
16 | import tools.refinery.store.query.view.FilteredRelationView; | 16 | import tools.refinery.store.query.view.FilteredView; |
17 | import tools.refinery.store.query.view.FunctionalRelationView; | 17 | import tools.refinery.store.query.view.FunctionView; |
18 | import tools.refinery.store.query.view.KeyOnlyRelationView; | 18 | import tools.refinery.store.query.view.KeyOnlyView; |
19 | import tools.refinery.store.representation.Symbol; | 19 | import tools.refinery.store.representation.Symbol; |
20 | import tools.refinery.store.representation.TruthValue; | 20 | import tools.refinery.store.representation.TruthValue; |
21 | import tools.refinery.store.tuple.Tuple; | 21 | import tools.refinery.store.tuple.Tuple; |
@@ -38,8 +38,8 @@ class FunctionalQueryTest { | |||
38 | void inputKeyTest(QueryEvaluationHint hint) { | 38 | void inputKeyTest(QueryEvaluationHint hint) { |
39 | var person = new Symbol<>("Person", 1, Boolean.class, false); | 39 | var person = new Symbol<>("Person", 1, Boolean.class, false); |
40 | var age = new Symbol<>("age", 1, Integer.class, null); | 40 | var age = new Symbol<>("age", 1, Integer.class, null); |
41 | var personView = new KeyOnlyRelationView<>(person); | 41 | var personView = new KeyOnlyView<>(person); |
42 | var ageView = new FunctionalRelationView<>(age); | 42 | var ageView = new FunctionView<>(age); |
43 | 43 | ||
44 | var p1 = Variable.of("p1"); | 44 | var p1 = Variable.of("p1"); |
45 | var x = Variable.of("x", Integer.class); | 45 | var x = Variable.of("x", Integer.class); |
@@ -84,8 +84,8 @@ class FunctionalQueryTest { | |||
84 | void predicateTest(QueryEvaluationHint hint) { | 84 | void predicateTest(QueryEvaluationHint hint) { |
85 | var person = new Symbol<>("Person", 1, Boolean.class, false); | 85 | var person = new Symbol<>("Person", 1, Boolean.class, false); |
86 | var age = new Symbol<>("age", 1, Integer.class, null); | 86 | var age = new Symbol<>("age", 1, Integer.class, null); |
87 | var personView = new KeyOnlyRelationView<>(person); | 87 | var personView = new KeyOnlyView<>(person); |
88 | var ageView = new FunctionalRelationView<>(age); | 88 | var ageView = new FunctionView<>(age); |
89 | 89 | ||
90 | var p1 = Variable.of("p1"); | 90 | var p1 = Variable.of("p1"); |
91 | var x = Variable.of("x", Integer.class); | 91 | var x = Variable.of("x", Integer.class); |
@@ -137,8 +137,8 @@ class FunctionalQueryTest { | |||
137 | void computationTest(QueryEvaluationHint hint) { | 137 | void computationTest(QueryEvaluationHint hint) { |
138 | var person = new Symbol<>("Person", 1, Boolean.class, false); | 138 | var person = new Symbol<>("Person", 1, Boolean.class, false); |
139 | var age = new Symbol<>("age", 1, Integer.class, null); | 139 | var age = new Symbol<>("age", 1, Integer.class, null); |
140 | var personView = new KeyOnlyRelationView<>(person); | 140 | var personView = new KeyOnlyView<>(person); |
141 | var ageView = new FunctionalRelationView<>(age); | 141 | var ageView = new FunctionView<>(age); |
142 | 142 | ||
143 | var p1 = Variable.of("p1"); | 143 | var p1 = Variable.of("p1"); |
144 | var x = Variable.of("x", Integer.class); | 144 | var x = Variable.of("x", Integer.class); |
@@ -184,8 +184,8 @@ class FunctionalQueryTest { | |||
184 | void inputKeyCountTest(QueryEvaluationHint hint) { | 184 | void inputKeyCountTest(QueryEvaluationHint hint) { |
185 | var person = new Symbol<>("Person", 1, Boolean.class, false); | 185 | var person = new Symbol<>("Person", 1, Boolean.class, false); |
186 | var friend = new Symbol<>("friend", 2, TruthValue.class, TruthValue.FALSE); | 186 | var friend = new Symbol<>("friend", 2, TruthValue.class, TruthValue.FALSE); |
187 | var personView = new KeyOnlyRelationView<>(person); | 187 | var personView = new KeyOnlyView<>(person); |
188 | var friendMustView = new FilteredRelationView<>(friend, "must", TruthValue::must); | 188 | var friendMustView = new FilteredView<>(friend, "must", TruthValue::must); |
189 | 189 | ||
190 | var p1 = Variable.of("p1"); | 190 | var p1 = Variable.of("p1"); |
191 | var p2 = Variable.of("p2"); | 191 | var p2 = Variable.of("p2"); |
@@ -233,8 +233,8 @@ class FunctionalQueryTest { | |||
233 | void predicateCountTest(QueryEvaluationHint hint) { | 233 | void predicateCountTest(QueryEvaluationHint hint) { |
234 | var person = new Symbol<>("Person", 1, Boolean.class, false); | 234 | var person = new Symbol<>("Person", 1, Boolean.class, false); |
235 | var friend = new Symbol<>("friend", 2, TruthValue.class, TruthValue.FALSE); | 235 | var friend = new Symbol<>("friend", 2, TruthValue.class, TruthValue.FALSE); |
236 | var personView = new KeyOnlyRelationView<>(person); | 236 | var personView = new KeyOnlyView<>(person); |
237 | var friendMustView = new FilteredRelationView<>(friend, "must", TruthValue::must); | 237 | var friendMustView = new FilteredView<>(friend, "must", TruthValue::must); |
238 | 238 | ||
239 | var p1 = Variable.of("p1"); | 239 | var p1 = Variable.of("p1"); |
240 | var p2 = Variable.of("p2"); | 240 | var p2 = Variable.of("p2"); |
@@ -289,7 +289,7 @@ class FunctionalQueryTest { | |||
289 | @QueryEngineTest | 289 | @QueryEngineTest |
290 | void inputKeyAggregationTest(QueryEvaluationHint hint) { | 290 | void inputKeyAggregationTest(QueryEvaluationHint hint) { |
291 | var age = new Symbol<>("age", 1, Integer.class, null); | 291 | var age = new Symbol<>("age", 1, Integer.class, null); |
292 | var ageView = new FunctionalRelationView<>(age); | 292 | var ageView = new FunctionView<>(age); |
293 | 293 | ||
294 | var p1 = Variable.of("p1"); | 294 | var p1 = Variable.of("p1"); |
295 | var x = Variable.of("x", Integer.class); | 295 | var x = Variable.of("x", Integer.class); |
@@ -324,8 +324,8 @@ class FunctionalQueryTest { | |||
324 | void predicateAggregationTest(QueryEvaluationHint hint) { | 324 | void predicateAggregationTest(QueryEvaluationHint hint) { |
325 | var person = new Symbol<>("Person", 1, Boolean.class, false); | 325 | var person = new Symbol<>("Person", 1, Boolean.class, false); |
326 | var age = new Symbol<>("age", 1, Integer.class, null); | 326 | var age = new Symbol<>("age", 1, Integer.class, null); |
327 | var personView = new KeyOnlyRelationView<>(person); | 327 | var personView = new KeyOnlyView<>(person); |
328 | var ageView = new FunctionalRelationView<>(age); | 328 | var ageView = new FunctionView<>(age); |
329 | 329 | ||
330 | var p1 = Variable.of("p1"); | 330 | var p1 = Variable.of("p1"); |
331 | var x = Variable.of("x", Integer.class); | 331 | var x = Variable.of("x", Integer.class); |
@@ -371,8 +371,8 @@ class FunctionalQueryTest { | |||
371 | void extremeValueTest(QueryEvaluationHint hint) { | 371 | void extremeValueTest(QueryEvaluationHint hint) { |
372 | var person = new Symbol<>("Person", 1, Boolean.class, false); | 372 | var person = new Symbol<>("Person", 1, Boolean.class, false); |
373 | var friend = new Symbol<>("friend", 2, TruthValue.class, TruthValue.FALSE); | 373 | var friend = new Symbol<>("friend", 2, TruthValue.class, TruthValue.FALSE); |
374 | var personView = new KeyOnlyRelationView<>(person); | 374 | var personView = new KeyOnlyView<>(person); |
375 | var friendMustView = new FilteredRelationView<>(friend, "must", TruthValue::must); | 375 | var friendMustView = new FilteredView<>(friend, "must", TruthValue::must); |
376 | 376 | ||
377 | var p1 = Variable.of("p1"); | 377 | var p1 = Variable.of("p1"); |
378 | var p2 = Variable.of("p2"); | 378 | var p2 = Variable.of("p2"); |
@@ -447,8 +447,8 @@ class FunctionalQueryTest { | |||
447 | void invalidComputationTest(QueryEvaluationHint hint) { | 447 | void invalidComputationTest(QueryEvaluationHint hint) { |
448 | var person = new Symbol<>("Person", 1, Boolean.class, false); | 448 | var person = new Symbol<>("Person", 1, Boolean.class, false); |
449 | var age = new Symbol<>("age", 1, Integer.class, null); | 449 | var age = new Symbol<>("age", 1, Integer.class, null); |
450 | var personView = new KeyOnlyRelationView<>(person); | 450 | var personView = new KeyOnlyView<>(person); |
451 | var ageView = new FunctionalRelationView<>(age); | 451 | var ageView = new FunctionView<>(age); |
452 | 452 | ||
453 | var p1 = Variable.of("p1"); | 453 | var p1 = Variable.of("p1"); |
454 | var x = Variable.of("x", Integer.class); | 454 | var x = Variable.of("x", Integer.class); |
@@ -494,8 +494,8 @@ class FunctionalQueryTest { | |||
494 | void invalidAssumeTest(QueryEvaluationHint hint) { | 494 | void invalidAssumeTest(QueryEvaluationHint hint) { |
495 | var person = new Symbol<>("Person", 1, Boolean.class, false); | 495 | var person = new Symbol<>("Person", 1, Boolean.class, false); |
496 | var age = new Symbol<>("age", 1, Integer.class, null); | 496 | var age = new Symbol<>("age", 1, Integer.class, null); |
497 | var personView = new KeyOnlyRelationView<>(person); | 497 | var personView = new KeyOnlyView<>(person); |
498 | var ageView = new FunctionalRelationView<>(age); | 498 | var ageView = new FunctionView<>(age); |
499 | 499 | ||
500 | var p1 = Variable.of("p1"); | 500 | var p1 = Variable.of("p1"); |
501 | var x = Variable.of("x", Integer.class); | 501 | var x = Variable.of("x", Integer.class); |
@@ -543,9 +543,9 @@ class FunctionalQueryTest { | |||
543 | var person = new Symbol<>("Person", 1, Boolean.class, false); | 543 | var person = new Symbol<>("Person", 1, Boolean.class, false); |
544 | var age = new Symbol<>("age", 1, Integer.class, null); | 544 | var age = new Symbol<>("age", 1, Integer.class, null); |
545 | var friend = new Symbol<>("friend", 2, TruthValue.class, TruthValue.FALSE); | 545 | var friend = new Symbol<>("friend", 2, TruthValue.class, TruthValue.FALSE); |
546 | var personView = new KeyOnlyRelationView<>(person); | 546 | var personView = new KeyOnlyView<>(person); |
547 | var ageView = new FunctionalRelationView<>(age); | 547 | var ageView = new FunctionView<>(age); |
548 | var friendMustView = new FilteredRelationView<>(friend, "must", TruthValue::must); | 548 | var friendMustView = new FilteredView<>(friend, "must", TruthValue::must); |
549 | 549 | ||
550 | var p1 = Variable.of("p1"); | 550 | var p1 = Variable.of("p1"); |
551 | var p2 = Variable.of("p2"); | 551 | var p2 = Variable.of("p2"); |
diff --git a/subprojects/store-query-viatra/src/test/java/tools/refinery/store/query/viatra/QueryTest.java b/subprojects/store-query-viatra/src/test/java/tools/refinery/store/query/viatra/QueryTest.java index e82f0a15..11ee98f5 100644 --- a/subprojects/store-query-viatra/src/test/java/tools/refinery/store/query/viatra/QueryTest.java +++ b/subprojects/store-query-viatra/src/test/java/tools/refinery/store/query/viatra/QueryTest.java | |||
@@ -13,9 +13,9 @@ import tools.refinery.store.query.dnf.Dnf; | |||
13 | import tools.refinery.store.query.dnf.Query; | 13 | import tools.refinery.store.query.dnf.Query; |
14 | import tools.refinery.store.query.term.Variable; | 14 | import tools.refinery.store.query.term.Variable; |
15 | import tools.refinery.store.query.viatra.tests.QueryEngineTest; | 15 | import tools.refinery.store.query.viatra.tests.QueryEngineTest; |
16 | import tools.refinery.store.query.view.FilteredRelationView; | 16 | import tools.refinery.store.query.view.FilteredView; |
17 | import tools.refinery.store.query.view.FunctionalRelationView; | 17 | import tools.refinery.store.query.view.FunctionView; |
18 | import tools.refinery.store.query.view.KeyOnlyRelationView; | 18 | import tools.refinery.store.query.view.KeyOnlyView; |
19 | import tools.refinery.store.representation.Symbol; | 19 | import tools.refinery.store.representation.Symbol; |
20 | import tools.refinery.store.representation.TruthValue; | 20 | import tools.refinery.store.representation.TruthValue; |
21 | import tools.refinery.store.tuple.Tuple; | 21 | import tools.refinery.store.tuple.Tuple; |
@@ -34,7 +34,7 @@ class QueryTest { | |||
34 | void typeConstraintTest(QueryEvaluationHint hint) { | 34 | void typeConstraintTest(QueryEvaluationHint hint) { |
35 | var person = new Symbol<>("Person", 1, Boolean.class, false); | 35 | var person = new Symbol<>("Person", 1, Boolean.class, false); |
36 | var asset = new Symbol<>("Asset", 1, Boolean.class, false); | 36 | var asset = new Symbol<>("Asset", 1, Boolean.class, false); |
37 | var personView = new KeyOnlyRelationView<>(person); | 37 | var personView = new KeyOnlyView<>(person); |
38 | 38 | ||
39 | var p1 = Variable.of("p1"); | 39 | var p1 = Variable.of("p1"); |
40 | var predicate = Query.builder("TypeConstraint") | 40 | var predicate = Query.builder("TypeConstraint") |
@@ -73,8 +73,8 @@ class QueryTest { | |||
73 | void relationConstraintTest(QueryEvaluationHint hint) { | 73 | void relationConstraintTest(QueryEvaluationHint hint) { |
74 | var person = new Symbol<>("Person", 1, Boolean.class, false); | 74 | var person = new Symbol<>("Person", 1, Boolean.class, false); |
75 | var friend = new Symbol<>("friend", 2, TruthValue.class, TruthValue.FALSE); | 75 | var friend = new Symbol<>("friend", 2, TruthValue.class, TruthValue.FALSE); |
76 | var personView = new KeyOnlyRelationView<>(person); | 76 | var personView = new KeyOnlyView<>(person); |
77 | var friendMustView = new FilteredRelationView<>(friend, "must", TruthValue::must); | 77 | var friendMustView = new FilteredView<>(friend, "must", TruthValue::must); |
78 | 78 | ||
79 | var p1 = Variable.of("p1"); | 79 | var p1 = Variable.of("p1"); |
80 | var p2 = Variable.of("p2"); | 80 | var p2 = Variable.of("p2"); |
@@ -122,8 +122,8 @@ class QueryTest { | |||
122 | void existTest(QueryEvaluationHint hint) { | 122 | void existTest(QueryEvaluationHint hint) { |
123 | var person = new Symbol<>("Person", 1, Boolean.class, false); | 123 | var person = new Symbol<>("Person", 1, Boolean.class, false); |
124 | var friend = new Symbol<>("friend", 2, TruthValue.class, TruthValue.FALSE); | 124 | var friend = new Symbol<>("friend", 2, TruthValue.class, TruthValue.FALSE); |
125 | var personView = new KeyOnlyRelationView<>(person); | 125 | var personView = new KeyOnlyView<>(person); |
126 | var friendMustView = new FilteredRelationView<>(friend, "must", TruthValue::must); | 126 | var friendMustView = new FilteredView<>(friend, "must", TruthValue::must); |
127 | 127 | ||
128 | var p1 = Variable.of("p1"); | 128 | var p1 = Variable.of("p1"); |
129 | var p2 = Variable.of("p2"); | 129 | var p2 = Variable.of("p2"); |
@@ -172,9 +172,9 @@ class QueryTest { | |||
172 | var person = new Symbol<>("Person", 1, Boolean.class, false); | 172 | var person = new Symbol<>("Person", 1, Boolean.class, false); |
173 | var animal = new Symbol<>("Animal", 1, Boolean.class, false); | 173 | var animal = new Symbol<>("Animal", 1, Boolean.class, false); |
174 | var friend = new Symbol<>("friend", 2, TruthValue.class, TruthValue.FALSE); | 174 | var friend = new Symbol<>("friend", 2, TruthValue.class, TruthValue.FALSE); |
175 | var personView = new KeyOnlyRelationView<>(person); | 175 | var personView = new KeyOnlyView<>(person); |
176 | var animalView = new KeyOnlyRelationView<>(animal); | 176 | var animalView = new KeyOnlyView<>(animal); |
177 | var friendMustView = new FilteredRelationView<>(friend, "must", TruthValue::must); | 177 | var friendMustView = new FilteredView<>(friend, "must", TruthValue::must); |
178 | 178 | ||
179 | var p1 = Variable.of("p1"); | 179 | var p1 = Variable.of("p1"); |
180 | var p2 = Variable.of("p2"); | 180 | var p2 = Variable.of("p2"); |
@@ -230,7 +230,7 @@ class QueryTest { | |||
230 | @QueryEngineTest | 230 | @QueryEngineTest |
231 | void equalityTest(QueryEvaluationHint hint) { | 231 | void equalityTest(QueryEvaluationHint hint) { |
232 | var person = new Symbol<>("Person", 1, Boolean.class, false); | 232 | var person = new Symbol<>("Person", 1, Boolean.class, false); |
233 | var personView = new KeyOnlyRelationView<>(person); | 233 | var personView = new KeyOnlyView<>(person); |
234 | 234 | ||
235 | var p1 = Variable.of("p1"); | 235 | var p1 = Variable.of("p1"); |
236 | var p2 = Variable.of("p2"); | 236 | var p2 = Variable.of("p2"); |
@@ -273,8 +273,8 @@ class QueryTest { | |||
273 | void inequalityTest(QueryEvaluationHint hint) { | 273 | void inequalityTest(QueryEvaluationHint hint) { |
274 | var person = new Symbol<>("Person", 1, Boolean.class, false); | 274 | var person = new Symbol<>("Person", 1, Boolean.class, false); |
275 | var friend = new Symbol<>("friend", 2, TruthValue.class, TruthValue.FALSE); | 275 | var friend = new Symbol<>("friend", 2, TruthValue.class, TruthValue.FALSE); |
276 | var personView = new KeyOnlyRelationView<>(person); | 276 | var personView = new KeyOnlyView<>(person); |
277 | var friendMustView = new FilteredRelationView<>(friend, "must", TruthValue::must); | 277 | var friendMustView = new FilteredView<>(friend, "must", TruthValue::must); |
278 | 278 | ||
279 | var p1 = Variable.of("p1"); | 279 | var p1 = Variable.of("p1"); |
280 | var p2 = Variable.of("p2"); | 280 | var p2 = Variable.of("p2"); |
@@ -322,8 +322,8 @@ class QueryTest { | |||
322 | void patternCallTest(QueryEvaluationHint hint) { | 322 | void patternCallTest(QueryEvaluationHint hint) { |
323 | var person = new Symbol<>("Person", 1, Boolean.class, false); | 323 | var person = new Symbol<>("Person", 1, Boolean.class, false); |
324 | var friend = new Symbol<>("friend", 2, TruthValue.class, TruthValue.FALSE); | 324 | var friend = new Symbol<>("friend", 2, TruthValue.class, TruthValue.FALSE); |
325 | var personView = new KeyOnlyRelationView<>(person); | 325 | var personView = new KeyOnlyView<>(person); |
326 | var friendMustView = new FilteredRelationView<>(friend, "must", TruthValue::must); | 326 | var friendMustView = new FilteredView<>(friend, "must", TruthValue::must); |
327 | 327 | ||
328 | var p1 = Variable.of("p1"); | 328 | var p1 = Variable.of("p1"); |
329 | var p2 = Variable.of("p2"); | 329 | var p2 = Variable.of("p2"); |
@@ -381,8 +381,8 @@ class QueryTest { | |||
381 | void negativeRelationViewTest(QueryEvaluationHint hint) { | 381 | void negativeRelationViewTest(QueryEvaluationHint hint) { |
382 | var person = new Symbol<>("Person", 1, Boolean.class, false); | 382 | var person = new Symbol<>("Person", 1, Boolean.class, false); |
383 | var friend = new Symbol<>("friend", 2, TruthValue.class, TruthValue.FALSE); | 383 | var friend = new Symbol<>("friend", 2, TruthValue.class, TruthValue.FALSE); |
384 | var personView = new KeyOnlyRelationView<>(person); | 384 | var personView = new KeyOnlyView<>(person); |
385 | var friendMustView = new FilteredRelationView<>(friend, "must", TruthValue::must); | 385 | var friendMustView = new FilteredView<>(friend, "must", TruthValue::must); |
386 | 386 | ||
387 | var p1 = Variable.of("p1"); | 387 | var p1 = Variable.of("p1"); |
388 | var p2 = Variable.of("p2"); | 388 | var p2 = Variable.of("p2"); |
@@ -435,8 +435,8 @@ class QueryTest { | |||
435 | void negativePatternCallTest(QueryEvaluationHint hint) { | 435 | void negativePatternCallTest(QueryEvaluationHint hint) { |
436 | var person = new Symbol<>("Person", 1, Boolean.class, false); | 436 | var person = new Symbol<>("Person", 1, Boolean.class, false); |
437 | var friend = new Symbol<>("friend", 2, TruthValue.class, TruthValue.FALSE); | 437 | var friend = new Symbol<>("friend", 2, TruthValue.class, TruthValue.FALSE); |
438 | var personView = new KeyOnlyRelationView<>(person); | 438 | var personView = new KeyOnlyView<>(person); |
439 | var friendMustView = new FilteredRelationView<>(friend, "must", TruthValue::must); | 439 | var friendMustView = new FilteredView<>(friend, "must", TruthValue::must); |
440 | 440 | ||
441 | var p1 = Variable.of("p1"); | 441 | var p1 = Variable.of("p1"); |
442 | var p2 = Variable.of("p2"); | 442 | var p2 = Variable.of("p2"); |
@@ -500,8 +500,8 @@ class QueryTest { | |||
500 | void negativeRelationViewWithQuantificationTest(QueryEvaluationHint hint) { | 500 | void negativeRelationViewWithQuantificationTest(QueryEvaluationHint hint) { |
501 | var person = new Symbol<>("Person", 1, Boolean.class, false); | 501 | var person = new Symbol<>("Person", 1, Boolean.class, false); |
502 | var friend = new Symbol<>("friend", 2, TruthValue.class, TruthValue.FALSE); | 502 | var friend = new Symbol<>("friend", 2, TruthValue.class, TruthValue.FALSE); |
503 | var personView = new KeyOnlyRelationView<>(person); | 503 | var personView = new KeyOnlyView<>(person); |
504 | var friendMustView = new FilteredRelationView<>(friend, "must", TruthValue::must); | 504 | var friendMustView = new FilteredView<>(friend, "must", TruthValue::must); |
505 | 505 | ||
506 | var p1 = Variable.of("p1"); | 506 | var p1 = Variable.of("p1"); |
507 | var p2 = Variable.of("p2"); | 507 | var p2 = Variable.of("p2"); |
@@ -547,8 +547,8 @@ class QueryTest { | |||
547 | void negativeWithQuantificationTest(QueryEvaluationHint hint) { | 547 | void negativeWithQuantificationTest(QueryEvaluationHint hint) { |
548 | var person = new Symbol<>("Person", 1, Boolean.class, false); | 548 | var person = new Symbol<>("Person", 1, Boolean.class, false); |
549 | var friend = new Symbol<>("friend", 2, TruthValue.class, TruthValue.FALSE); | 549 | var friend = new Symbol<>("friend", 2, TruthValue.class, TruthValue.FALSE); |
550 | var personView = new KeyOnlyRelationView<>(person); | 550 | var personView = new KeyOnlyView<>(person); |
551 | var friendMustView = new FilteredRelationView<>(friend, "must", TruthValue::must); | 551 | var friendMustView = new FilteredView<>(friend, "must", TruthValue::must); |
552 | 552 | ||
553 | var p1 = Variable.of("p1"); | 553 | var p1 = Variable.of("p1"); |
554 | var p2 = Variable.of("p2"); | 554 | var p2 = Variable.of("p2"); |
@@ -603,8 +603,8 @@ class QueryTest { | |||
603 | void transitiveRelationViewTest(QueryEvaluationHint hint) { | 603 | void transitiveRelationViewTest(QueryEvaluationHint hint) { |
604 | var person = new Symbol<>("Person", 1, Boolean.class, false); | 604 | var person = new Symbol<>("Person", 1, Boolean.class, false); |
605 | var friend = new Symbol<>("friend", 2, TruthValue.class, TruthValue.FALSE); | 605 | var friend = new Symbol<>("friend", 2, TruthValue.class, TruthValue.FALSE); |
606 | var personView = new KeyOnlyRelationView<>(person); | 606 | var personView = new KeyOnlyView<>(person); |
607 | var friendMustView = new FilteredRelationView<>(friend, "must", TruthValue::must); | 607 | var friendMustView = new FilteredView<>(friend, "must", TruthValue::must); |
608 | 608 | ||
609 | var p1 = Variable.of("p1"); | 609 | var p1 = Variable.of("p1"); |
610 | var p2 = Variable.of("p2"); | 610 | var p2 = Variable.of("p2"); |
@@ -656,8 +656,8 @@ class QueryTest { | |||
656 | void transitivePatternCallTest(QueryEvaluationHint hint) { | 656 | void transitivePatternCallTest(QueryEvaluationHint hint) { |
657 | var person = new Symbol<>("Person", 1, Boolean.class, false); | 657 | var person = new Symbol<>("Person", 1, Boolean.class, false); |
658 | var friend = new Symbol<>("friend", 2, TruthValue.class, TruthValue.FALSE); | 658 | var friend = new Symbol<>("friend", 2, TruthValue.class, TruthValue.FALSE); |
659 | var personView = new KeyOnlyRelationView<>(person); | 659 | var personView = new KeyOnlyView<>(person); |
660 | var friendMustView = new FilteredRelationView<>(friend, "must", TruthValue::must); | 660 | var friendMustView = new FilteredView<>(friend, "must", TruthValue::must); |
661 | 661 | ||
662 | var p1 = Variable.of("p1"); | 662 | var p1 = Variable.of("p1"); |
663 | var p2 = Variable.of("p2"); | 663 | var p2 = Variable.of("p2"); |
@@ -720,8 +720,8 @@ class QueryTest { | |||
720 | void assumeTest(QueryEvaluationHint hint) { | 720 | void assumeTest(QueryEvaluationHint hint) { |
721 | var person = new Symbol<>("Person", 1, Boolean.class, false); | 721 | var person = new Symbol<>("Person", 1, Boolean.class, false); |
722 | var age = new Symbol<>("age", 1, Integer.class, null); | 722 | var age = new Symbol<>("age", 1, Integer.class, null); |
723 | var personView = new KeyOnlyRelationView<>(person); | 723 | var personView = new KeyOnlyView<>(person); |
724 | var ageView = new FunctionalRelationView<>(age); | 724 | var ageView = new FunctionView<>(age); |
725 | 725 | ||
726 | var p1 = Variable.of("p1"); | 726 | var p1 = Variable.of("p1"); |
727 | var x = Variable.of("x", Integer.class); | 727 | var x = Variable.of("x", Integer.class); |
diff --git a/subprojects/store-query-viatra/src/test/java/tools/refinery/store/query/viatra/QueryTransactionTest.java b/subprojects/store-query-viatra/src/test/java/tools/refinery/store/query/viatra/QueryTransactionTest.java index 07b799ac..bd6b6b81 100644 --- a/subprojects/store-query-viatra/src/test/java/tools/refinery/store/query/viatra/QueryTransactionTest.java +++ b/subprojects/store-query-viatra/src/test/java/tools/refinery/store/query/viatra/QueryTransactionTest.java | |||
@@ -12,9 +12,9 @@ import tools.refinery.store.model.ModelStore; | |||
12 | import tools.refinery.store.query.ModelQuery; | 12 | import tools.refinery.store.query.ModelQuery; |
13 | import tools.refinery.store.query.dnf.Query; | 13 | import tools.refinery.store.query.dnf.Query; |
14 | import tools.refinery.store.query.term.Variable; | 14 | import tools.refinery.store.query.term.Variable; |
15 | import tools.refinery.store.query.view.FilteredRelationView; | 15 | import tools.refinery.store.query.view.FilteredView; |
16 | import tools.refinery.store.query.view.FunctionalRelationView; | 16 | import tools.refinery.store.query.view.FunctionView; |
17 | import tools.refinery.store.query.view.KeyOnlyRelationView; | 17 | import tools.refinery.store.query.view.KeyOnlyView; |
18 | import tools.refinery.store.representation.Symbol; | 18 | import tools.refinery.store.representation.Symbol; |
19 | import tools.refinery.store.tuple.Tuple; | 19 | import tools.refinery.store.tuple.Tuple; |
20 | 20 | ||
@@ -30,7 +30,7 @@ class QueryTransactionTest { | |||
30 | @Test | 30 | @Test |
31 | void flushTest() { | 31 | void flushTest() { |
32 | var person = new Symbol<>("Person", 1, Boolean.class, false); | 32 | var person = new Symbol<>("Person", 1, Boolean.class, false); |
33 | var personView = new KeyOnlyRelationView<>(person); | 33 | var personView = new KeyOnlyView<>(person); |
34 | 34 | ||
35 | var p1 = Variable.of("p1"); | 35 | var p1 = Variable.of("p1"); |
36 | var predicate = Query.builder("TypeConstraint") | 36 | var predicate = Query.builder("TypeConstraint") |
@@ -101,7 +101,7 @@ class QueryTransactionTest { | |||
101 | @Test | 101 | @Test |
102 | void localSearchTest() { | 102 | void localSearchTest() { |
103 | var person = new Symbol<>("Person", 1, Boolean.class, false); | 103 | var person = new Symbol<>("Person", 1, Boolean.class, false); |
104 | var personView = new KeyOnlyRelationView<>(person); | 104 | var personView = new KeyOnlyView<>(person); |
105 | 105 | ||
106 | var p1 = Variable.of("p1"); | 106 | var p1 = Variable.of("p1"); |
107 | var predicate = Query.builder("TypeConstraint") | 107 | var predicate = Query.builder("TypeConstraint") |
@@ -156,7 +156,7 @@ class QueryTransactionTest { | |||
156 | void unrelatedChangesTest() { | 156 | void unrelatedChangesTest() { |
157 | var person = new Symbol<>("Person", 1, Boolean.class, false); | 157 | var person = new Symbol<>("Person", 1, Boolean.class, false); |
158 | var asset = new Symbol<>("Asset", 1, Boolean.class, false); | 158 | var asset = new Symbol<>("Asset", 1, Boolean.class, false); |
159 | var personView = new KeyOnlyRelationView<>(person); | 159 | var personView = new KeyOnlyView<>(person); |
160 | 160 | ||
161 | var p1 = Variable.of("p1"); | 161 | var p1 = Variable.of("p1"); |
162 | var predicate = Query.builder("TypeConstraint") | 162 | var predicate = Query.builder("TypeConstraint") |
@@ -229,8 +229,8 @@ class QueryTransactionTest { | |||
229 | void tupleChangingChangeTest() { | 229 | void tupleChangingChangeTest() { |
230 | var person = new Symbol<>("Person", 1, Boolean.class, false); | 230 | var person = new Symbol<>("Person", 1, Boolean.class, false); |
231 | var age = new Symbol<>("age", 1, Integer.class, null); | 231 | var age = new Symbol<>("age", 1, Integer.class, null); |
232 | var personView = new KeyOnlyRelationView<>(person); | 232 | var personView = new KeyOnlyView<>(person); |
233 | var ageView = new FunctionalRelationView<>(age); | 233 | var ageView = new FunctionView<>(age); |
234 | 234 | ||
235 | var p1 = Variable.of("p1"); | 235 | var p1 = Variable.of("p1"); |
236 | var x = Variable.of("x", Integer.class); | 236 | var x = Variable.of("x", Integer.class); |
@@ -277,8 +277,8 @@ class QueryTransactionTest { | |||
277 | void tuplePreservingUnchangedTest() { | 277 | void tuplePreservingUnchangedTest() { |
278 | var person = new Symbol<>("Person", 1, Boolean.class, false); | 278 | var person = new Symbol<>("Person", 1, Boolean.class, false); |
279 | var age = new Symbol<>("age", 1, Integer.class, null); | 279 | var age = new Symbol<>("age", 1, Integer.class, null); |
280 | var personView = new KeyOnlyRelationView<>(person); | 280 | var personView = new KeyOnlyView<>(person); |
281 | var adultView = new FilteredRelationView<>(age, "adult", n -> n != null && n >= 18); | 281 | var adultView = new FilteredView<>(age, "adult", n -> n != null && n >= 18); |
282 | 282 | ||
283 | var p1 = Variable.of("p1"); | 283 | var p1 = Variable.of("p1"); |
284 | var x = Variable.of("x", Integer.class); | 284 | var x = Variable.of("x", Integer.class); |
@@ -324,7 +324,7 @@ class QueryTransactionTest { | |||
324 | @Test | 324 | @Test |
325 | void commitAfterFlushTest() { | 325 | void commitAfterFlushTest() { |
326 | var person = new Symbol<>("Person", 1, Boolean.class, false); | 326 | var person = new Symbol<>("Person", 1, Boolean.class, false); |
327 | var personView = new KeyOnlyRelationView<>(person); | 327 | var personView = new KeyOnlyView<>(person); |
328 | 328 | ||
329 | var p1 = Variable.of("p1"); | 329 | var p1 = Variable.of("p1"); |
330 | var predicate = Query.builder("TypeConstraint") | 330 | var predicate = Query.builder("TypeConstraint") |
@@ -382,7 +382,7 @@ class QueryTransactionTest { | |||
382 | @Test | 382 | @Test |
383 | void commitWithoutFlushTest() { | 383 | void commitWithoutFlushTest() { |
384 | var person = new Symbol<>("Person", 1, Boolean.class, false); | 384 | var person = new Symbol<>("Person", 1, Boolean.class, false); |
385 | var personView = new KeyOnlyRelationView<>(person); | 385 | var personView = new KeyOnlyView<>(person); |
386 | 386 | ||
387 | var p1 = Variable.of("p1"); | 387 | var p1 = Variable.of("p1"); |
388 | var predicate = Query.builder("TypeConstraint") | 388 | var predicate = Query.builder("TypeConstraint") |