[NO-ISSUE][GRAPHIX] Large Graphix update.
Large commit for the following:
- Using AbstractClauseExtension.
- LEFT-MATCH now defaults to a non-foldable-action.
- Refactor of some docstrings to use HTML lists.
- Starting work towards adding using SWITCH and CYCLE at Graphix.
- Adding support for implicit correlated vertex JOINs.
- Adding support for graphs with duplicate schema edge labels.
- Adding support for unconditional schema decoration.
- Adding support for negated edge labels.
- Total revamp for schema resolution: we now take an exhaustive approach.
- Adding support for specifying Graphix compiler options in the config file.
Change-Id: I120362128a5557f7de8904b86bacde3b606760db
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb-graph/+/17235
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Glenn Galvizo <ggalvizo@uci.edu>
diff --git a/asterix-graphix/src/test/resources/runtimets/queries/graphix/scope-checking/scope-checking.1.ddl.sqlpp b/asterix-graphix/src/test/resources/runtimets/queries/graphix/correlated-vertex-join/correlated-vertex-join.1.ddl.sqlpp
similarity index 100%
copy from asterix-graphix/src/test/resources/runtimets/queries/graphix/scope-checking/scope-checking.1.ddl.sqlpp
copy to asterix-graphix/src/test/resources/runtimets/queries/graphix/correlated-vertex-join/correlated-vertex-join.1.ddl.sqlpp
diff --git a/asterix-graphix/src/test/resources/runtimets/queries/graphix/scope-checking/scope-checking.2.update.sqlpp b/asterix-graphix/src/test/resources/runtimets/queries/graphix/correlated-vertex-join/correlated-vertex-join.2.update.sqlpp
similarity index 100%
copy from asterix-graphix/src/test/resources/runtimets/queries/graphix/scope-checking/scope-checking.2.update.sqlpp
copy to asterix-graphix/src/test/resources/runtimets/queries/graphix/correlated-vertex-join/correlated-vertex-join.2.update.sqlpp
diff --git a/asterix-graphix/src/test/resources/runtimets/queries/graphix/scope-checking/scope-checking.3.query.sqlpp b/asterix-graphix/src/test/resources/runtimets/queries/graphix/correlated-vertex-join/correlated-vertex-join.3.query.sqlpp
similarity index 95%
rename from asterix-graphix/src/test/resources/runtimets/queries/graphix/scope-checking/scope-checking.3.query.sqlpp
rename to asterix-graphix/src/test/resources/runtimets/queries/graphix/correlated-vertex-join/correlated-vertex-join.3.query.sqlpp
index 8122ce1..9252f72 100644
--- a/asterix-graphix/src/test/resources/runtimets/queries/graphix/scope-checking/scope-checking.3.query.sqlpp
+++ b/asterix-graphix/src/test/resources/runtimets/queries/graphix/correlated-vertex-join/correlated-vertex-join.3.query.sqlpp
@@ -17,7 +17,7 @@
* under the License.
*/
-// Subquery expressing anti-join of patterns.
+// Subquery expressing anti-join of patterns from different graphs.
FROM GRAPH VERTEX (:User)
PRIMARY KEY (user_id)
AS Yelp.Users,
diff --git a/asterix-graphix/src/test/resources/runtimets/queries/graphix/scope-checking/scope-checking.4.query.sqlpp b/asterix-graphix/src/test/resources/runtimets/queries/graphix/correlated-vertex-join/correlated-vertex-join.4.query.sqlpp
similarity index 100%
rename from asterix-graphix/src/test/resources/runtimets/queries/graphix/scope-checking/scope-checking.4.query.sqlpp
rename to asterix-graphix/src/test/resources/runtimets/queries/graphix/correlated-vertex-join/correlated-vertex-join.4.query.sqlpp
diff --git a/asterix-graphix/src/test/resources/runtimets/queries/graphix/correlated-vertex-join/correlated-vertex-join.5.query.sqlpp b/asterix-graphix/src/test/resources/runtimets/queries/graphix/correlated-vertex-join/correlated-vertex-join.5.query.sqlpp
new file mode 100644
index 0000000..f2d93cd
--- /dev/null
+++ b/asterix-graphix/src/test/resources/runtimets/queries/graphix/correlated-vertex-join/correlated-vertex-join.5.query.sqlpp
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+// Implicit correlated vertex anti-JOIN.
+DECLARE GRAPH YelpGraph AS
+VERTEX (:User)
+ PRIMARY KEY (user_id)
+ AS Yelp.Users,
+VERTEX (:Review)
+ PRIMARY KEY (review_id)
+ AS Yelp.Reviews,
+EDGE (:Review)-[:MADE_BY]->(:User)
+ SOURCE KEY (review_id)
+ DESTINATION KEY (user_id)
+ AS ( FROM Yelp.Reviews R
+ SELECT R.review_id, R.user_id );
+
+FROM GRAPH YelpGraph
+MATCH (u:User)<-(r)
+WHERE NOT EXISTS ( FROM GRAPH YelpGraph
+ MATCH (u)
+ WHERE u.user_id = 1
+ SELECT VALUE 1 )
+SELECT u.user_id, r.review_id
+ORDER BY u.user_id, r.review_id;
\ No newline at end of file
diff --git a/asterix-graphix/src/test/resources/runtimets/queries/graphix/dangling-vertices/dangling-vertices.5.query.sqlpp b/asterix-graphix/src/test/resources/runtimets/queries/graphix/dangling-vertices/dangling-vertices.5.query.sqlpp
index 78851df..f9ea1cd 100644
--- a/asterix-graphix/src/test/resources/runtimets/queries/graphix/dangling-vertices/dangling-vertices.5.query.sqlpp
+++ b/asterix-graphix/src/test/resources/runtimets/queries/graphix/dangling-vertices/dangling-vertices.5.query.sqlpp
@@ -17,7 +17,7 @@
* under the License.
*/
--- param max-warnings:string=2
+-- param max-warnings:string=3
// There are two dangling vertices of different labels, and zero edges.
FROM GRAPH Yelp.YelpGraph
diff --git a/asterix-graphix/src/test/resources/runtimets/queries/graphix/graph-isomorphism/graph-isomorphism.6.query.sqlpp b/asterix-graphix/src/test/resources/runtimets/queries/graphix/graph-isomorphism/graph-isomorphism.6.query.sqlpp
index e3f1e7c..49e851b 100644
--- a/asterix-graphix/src/test/resources/runtimets/queries/graphix/graph-isomorphism/graph-isomorphism.6.query.sqlpp
+++ b/asterix-graphix/src/test/resources/runtimets/queries/graphix/graph-isomorphism/graph-isomorphism.6.query.sqlpp
@@ -18,7 +18,7 @@
*/
// There should be results where (u) = (v).
-SET `graphix.match-evaluation` "homomorphism";
+SET `graphix.semantics.pattern` "homomorphism";
FROM GRAPH VERTEX (:User)
PRIMARY KEY (user_id)
AS Yelp.Users
diff --git a/asterix-graphix/src/test/resources/runtimets/queries/graphix/graph-isomorphism/graph-isomorphism.7.query.sqlpp b/asterix-graphix/src/test/resources/runtimets/queries/graphix/graph-isomorphism/graph-isomorphism.7.query.sqlpp
index 0e2cbc9..8451d7d 100644
--- a/asterix-graphix/src/test/resources/runtimets/queries/graphix/graph-isomorphism/graph-isomorphism.7.query.sqlpp
+++ b/asterix-graphix/src/test/resources/runtimets/queries/graphix/graph-isomorphism/graph-isomorphism.7.query.sqlpp
@@ -18,7 +18,7 @@
*/
// There should be results where (u) = (w) (i.e. only edge adjacency should be preserved).
-SET `graphix.match-evaluation` "homomorphism";
+SET `graphix.semantics.pattern` "homomorphism";
FROM GRAPH VERTEX (:User)
PRIMARY KEY (user_id)
AS Yelp.Users,
diff --git a/asterix-graphix/src/test/resources/runtimets/queries/graphix/graphix-functions/graphix-functions.3.query.sqlpp b/asterix-graphix/src/test/resources/runtimets/queries/graphix/graphix-functions/graphix-functions.3.query.sqlpp
index 71e441c..7de7558 100644
--- a/asterix-graphix/src/test/resources/runtimets/queries/graphix/graphix-functions/graphix-functions.3.query.sqlpp
+++ b/asterix-graphix/src/test/resources/runtimets/queries/graphix/graphix-functions/graphix-functions.3.query.sqlpp
@@ -25,6 +25,6 @@
PRIMARY KEY (review_id)
AS Yelp.Reviews
MATCH (n)
-SELECT LABEL(n) AS vertexLabel,
+SELECT LABEL(n) AS elementLabel,
VERTEX_DETAIL(n) AS vertexDetail
ORDER BY n;
\ No newline at end of file
diff --git a/asterix-graphix/src/test/resources/runtimets/queries/graphix/graphix-functions/graphix-functions.4.query.sqlpp b/asterix-graphix/src/test/resources/runtimets/queries/graphix/graphix-functions/graphix-functions.4.query.sqlpp
index 0283334..b468c26 100644
--- a/asterix-graphix/src/test/resources/runtimets/queries/graphix/graphix-functions/graphix-functions.4.query.sqlpp
+++ b/asterix-graphix/src/test/resources/runtimets/queries/graphix/graphix-functions/graphix-functions.4.query.sqlpp
@@ -43,7 +43,7 @@
LABEL(e) AS edgeLabel,
LABEL(n1) AS n1Label,
LABEL(n2) AS n2Label,
- LABEL(sourceVertex) AS sourceVertexLabel,
- LABEL(destVertex) AS destVertexLabel,
+ LABEL(sourceVertex) AS sourceElementLabel,
+ LABEL(destVertex) AS destElementLabel,
EDGE_DETAIL(e) AS edgeDetail
ORDER BY direction, edgeLabel, n1Label, n2Label, edgeDetail;
\ No newline at end of file
diff --git a/asterix-graphix/src/test/resources/runtimets/queries/graphix/graphix-functions/graphix-functions.5.query.sqlpp b/asterix-graphix/src/test/resources/runtimets/queries/graphix/graphix-functions/graphix-functions.5.query.sqlpp
index a427758..08319e2 100644
--- a/asterix-graphix/src/test/resources/runtimets/queries/graphix/graphix-functions/graphix-functions.5.query.sqlpp
+++ b/asterix-graphix/src/test/resources/runtimets/queries/graphix/graphix-functions/graphix-functions.5.query.sqlpp
@@ -27,7 +27,7 @@
AS ( FROM Yelp.Friends F
SELECT F.user_id AS user_id,
F.friend AS friend )
-MATCH (n1)-[e:{1,2}]->(n2)->(n3) AS p
+MATCH (n1)-[e{1,2}]->(n2)->(n3) AS p
SELECT EDGES(p) AS pEdges,
EDGES(e) AS eEdges,
HOP_COUNT(p) AS pHopCount,
diff --git a/asterix-graphix/src/test/resources/runtimets/queries/graphix/on-query-error/on-query-error.13.query.sqlpp b/asterix-graphix/src/test/resources/runtimets/queries/graphix/on-query-error/on-query-error.13.query.sqlpp
new file mode 100644
index 0000000..a995d98
--- /dev/null
+++ b/asterix-graphix/src/test/resources/runtimets/queries/graphix/on-query-error/on-query-error.13.query.sqlpp
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+// Verify that a query that doesn't adhere to the graph schema returns an error.
+USE TestDataverse;
+FROM GRAPH VERTEX (:Vertex1)
+ PRIMARY KEY (_id)
+ AS GenericDataset,
+ VERTEX (:Vertex2)
+ PRIMARY KEY (_id)
+ AS GenericDataset,
+ EDGE (:Vertex1)-[:EDGE_1]->(:Vertex2)
+ SOURCE KEY (_id)
+ DESTINATION KEY (_to_id)
+ AS ( FROM GenericDataset GD
+ SELECT GD._id, GD._to_id )
+MATCH (v:Vertex1)<-[:EDGE_1]-(:Vertex2)
+SELECT v;
diff --git a/asterix-graphix/src/test/resources/runtimets/queries/graphix/path-variable/path-variable.6.query.sqlpp b/asterix-graphix/src/test/resources/runtimets/queries/graphix/path-variable/path-variable.6.query.sqlpp
index 595463c..3538605 100644
--- a/asterix-graphix/src/test/resources/runtimets/queries/graphix/path-variable/path-variable.6.query.sqlpp
+++ b/asterix-graphix/src/test/resources/runtimets/queries/graphix/path-variable/path-variable.6.query.sqlpp
@@ -27,7 +27,7 @@
AS ( FROM Yelp.Friends F
WHERE F.friend_group = "A"
SELECT F.user_id, F.friend )
-MATCH (u)-[e1:{1,2}]-(v) AS p
+MATCH (u)-[e1{1,2}]-(v) AS p
SELECT LEN(p.Edges) AS pathLength,
u.user_id AS u_user_id,
v.user_id AS v_user_id
diff --git a/asterix-graphix/src/test/resources/runtimets/queries/graphix/scope-checking/scope-checking.1.ddl.sqlpp b/asterix-graphix/src/test/resources/runtimets/queries/graphix/same-edge-label/same-edge-label.1.ddl.sqlpp
similarity index 100%
rename from asterix-graphix/src/test/resources/runtimets/queries/graphix/scope-checking/scope-checking.1.ddl.sqlpp
rename to asterix-graphix/src/test/resources/runtimets/queries/graphix/same-edge-label/same-edge-label.1.ddl.sqlpp
diff --git a/asterix-graphix/src/test/resources/runtimets/queries/graphix/scope-checking/scope-checking.2.update.sqlpp b/asterix-graphix/src/test/resources/runtimets/queries/graphix/same-edge-label/same-edge-label.2.update.sqlpp
similarity index 100%
rename from asterix-graphix/src/test/resources/runtimets/queries/graphix/scope-checking/scope-checking.2.update.sqlpp
rename to asterix-graphix/src/test/resources/runtimets/queries/graphix/same-edge-label/same-edge-label.2.update.sqlpp
diff --git a/asterix-graphix/src/test/resources/runtimets/queries/graphix/same-edge-label/same-edge-label.3.query.sqlpp b/asterix-graphix/src/test/resources/runtimets/queries/graphix/same-edge-label/same-edge-label.3.query.sqlpp
new file mode 100644
index 0000000..b11858b
--- /dev/null
+++ b/asterix-graphix/src/test/resources/runtimets/queries/graphix/same-edge-label/same-edge-label.3.query.sqlpp
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+// Query with a schema edge of the same label.
+DECLARE GRAPH YelpGraph AS
+VERTEX (:User)
+ PRIMARY KEY (user_id)
+ AS Yelp.Users,
+VERTEX (:Review)
+ PRIMARY KEY (review_id)
+ AS Yelp.Reviews,
+EDGE (:Review)-[:RELATED_TO]->(:User)
+ SOURCE KEY (review_id)
+ DESTINATION KEY (user_id)
+ AS ( FROM Yelp.Reviews R
+ SELECT R.review_id, R.user_id ),
+EDGE (:User)-[:RELATED_TO]->(:User)
+ SOURCE KEY (user_id)
+ DESTINATION KEY (friend)
+ AS ( FROM Yelp.Friends F
+ SELECT F.user_id, F.friend );
+
+FROM GRAPH YelpGraph
+MATCH (u)-[:RELATED_TO]->(v)
+SELECT v.user_id AS v_user_id,
+ CASE
+ WHEN LABEL(u) = "User"
+ THEN { "user_id": u.user_id }
+ WHEN LABEL(u) = "Review"
+ THEN { "review_id": u.review_id }
+ END AS u_record
+ORDER BY u, v;
\ No newline at end of file
diff --git a/asterix-graphix/src/test/resources/runtimets/queries/graphix/inference-resolution/inference-resolution.1.ddl.sqlpp b/asterix-graphix/src/test/resources/runtimets/queries/graphix/schema-resolution/schema-resolution.1.ddl.sqlpp
similarity index 100%
rename from asterix-graphix/src/test/resources/runtimets/queries/graphix/inference-resolution/inference-resolution.1.ddl.sqlpp
rename to asterix-graphix/src/test/resources/runtimets/queries/graphix/schema-resolution/schema-resolution.1.ddl.sqlpp
diff --git a/asterix-graphix/src/test/resources/runtimets/queries/graphix/inference-resolution/inference-resolution.2.update.sqlpp b/asterix-graphix/src/test/resources/runtimets/queries/graphix/schema-resolution/schema-resolution.2.update.sqlpp
similarity index 100%
rename from asterix-graphix/src/test/resources/runtimets/queries/graphix/inference-resolution/inference-resolution.2.update.sqlpp
rename to asterix-graphix/src/test/resources/runtimets/queries/graphix/schema-resolution/schema-resolution.2.update.sqlpp
diff --git a/asterix-graphix/src/test/resources/runtimets/queries/graphix/inference-resolution/inference-resolution.3.query.sqlpp b/asterix-graphix/src/test/resources/runtimets/queries/graphix/schema-resolution/schema-resolution.3.query.sqlpp
similarity index 96%
rename from asterix-graphix/src/test/resources/runtimets/queries/graphix/inference-resolution/inference-resolution.3.query.sqlpp
rename to asterix-graphix/src/test/resources/runtimets/queries/graphix/schema-resolution/schema-resolution.3.query.sqlpp
index 700fe8f..f1e7af5 100644
--- a/asterix-graphix/src/test/resources/runtimets/queries/graphix/inference-resolution/inference-resolution.3.query.sqlpp
+++ b/asterix-graphix/src/test/resources/runtimets/queries/graphix/schema-resolution/schema-resolution.3.query.sqlpp
@@ -20,7 +20,6 @@
-- param max-warnings:string=1
// We should be able to resolve both e and n, using the edge direction.
-SET `graphix.resolver` "inference-based";
FROM GRAPH VERTEX (:User)
PRIMARY KEY (user_id)
AS ( FROM Yelp.Users U
diff --git a/asterix-graphix/src/test/resources/runtimets/queries/graphix/inference-resolution/inference-resolution.4.query.sqlpp b/asterix-graphix/src/test/resources/runtimets/queries/graphix/schema-resolution/schema-resolution.4.query.sqlpp
similarity index 97%
rename from asterix-graphix/src/test/resources/runtimets/queries/graphix/inference-resolution/inference-resolution.4.query.sqlpp
rename to asterix-graphix/src/test/resources/runtimets/queries/graphix/schema-resolution/schema-resolution.4.query.sqlpp
index 5533ede..1b4282a 100644
--- a/asterix-graphix/src/test/resources/runtimets/queries/graphix/inference-resolution/inference-resolution.4.query.sqlpp
+++ b/asterix-graphix/src/test/resources/runtimets/queries/graphix/schema-resolution/schema-resolution.4.query.sqlpp
@@ -20,7 +20,6 @@
-- param max-warnings:string=1
// We should be able to resolve all elements (e, n, f, m), using the edge direction of the last edge in our pattern.
-SET `graphix.resolver` "inference-based";
FROM GRAPH VERTEX (:User)
PRIMARY KEY (user_id)
AS ( FROM Yelp.Users U
diff --git a/asterix-graphix/src/test/resources/runtimets/queries/graphix/inference-resolution/inference-resolution.5.query.sqlpp b/asterix-graphix/src/test/resources/runtimets/queries/graphix/schema-resolution/schema-resolution.5.query.sqlpp
similarity index 97%
rename from asterix-graphix/src/test/resources/runtimets/queries/graphix/inference-resolution/inference-resolution.5.query.sqlpp
rename to asterix-graphix/src/test/resources/runtimets/queries/graphix/schema-resolution/schema-resolution.5.query.sqlpp
index df7e676..9202011 100644
--- a/asterix-graphix/src/test/resources/runtimets/queries/graphix/inference-resolution/inference-resolution.5.query.sqlpp
+++ b/asterix-graphix/src/test/resources/runtimets/queries/graphix/schema-resolution/schema-resolution.5.query.sqlpp
@@ -20,7 +20,6 @@
-- param max-warnings:string=1
// We should be able to resolve all elements (e, n, f, last direction), using the edge direction of the first pattern.
-SET `graphix.resolver` "inference-based";
FROM GRAPH VERTEX (:User)
PRIMARY KEY (user_id)
AS ( FROM Yelp.Users U
diff --git a/asterix-graphix/src/test/resources/runtimets/queries/graphix/inference-resolution/inference-resolution.6.query.sqlpp b/asterix-graphix/src/test/resources/runtimets/queries/graphix/schema-resolution/schema-resolution.6.query.sqlpp
similarity index 94%
rename from asterix-graphix/src/test/resources/runtimets/queries/graphix/inference-resolution/inference-resolution.6.query.sqlpp
rename to asterix-graphix/src/test/resources/runtimets/queries/graphix/schema-resolution/schema-resolution.6.query.sqlpp
index 30de634..fa256a5 100644
--- a/asterix-graphix/src/test/resources/runtimets/queries/graphix/inference-resolution/inference-resolution.6.query.sqlpp
+++ b/asterix-graphix/src/test/resources/runtimets/queries/graphix/schema-resolution/schema-resolution.6.query.sqlpp
@@ -20,7 +20,6 @@
-- param max-warnings:string=1
// We should be able to resolve all elements (e, n, f, last direction), using the edge direction of the first pattern.
-SET `graphix.resolver` "inference-based";
FROM GRAPH VERTEX (:User)
PRIMARY KEY (user_id)
AS ( FROM Yelp.Users U
@@ -39,7 +38,7 @@
DESTINATION KEY (user_id)
AS ( FROM Yelp.Reviews R
SELECT R.review_id, R.user_id )
-MATCH (u:User)-[e:{2,2}]->(n) // (u:User)-[]->()-[]->(n)
+MATCH (u:User)-[e{2,2}]->(n) // (u:User)-[]->()-[]->(n)
UNNEST PATH_EDGES(e) AS ee
SELECT DISTINCT LABEL(ee) AS e_label,
LABEL(n) AS n_label,
diff --git a/asterix-graphix/src/test/resources/runtimets/queries/graphix/inference-resolution/inference-resolution.3.query.sqlpp b/asterix-graphix/src/test/resources/runtimets/queries/graphix/schema-resolution/schema-resolution.7.query.sqlpp
similarity index 89%
copy from asterix-graphix/src/test/resources/runtimets/queries/graphix/inference-resolution/inference-resolution.3.query.sqlpp
copy to asterix-graphix/src/test/resources/runtimets/queries/graphix/schema-resolution/schema-resolution.7.query.sqlpp
index 700fe8f..780f1a2 100644
--- a/asterix-graphix/src/test/resources/runtimets/queries/graphix/inference-resolution/inference-resolution.3.query.sqlpp
+++ b/asterix-graphix/src/test/resources/runtimets/queries/graphix/schema-resolution/schema-resolution.7.query.sqlpp
@@ -19,8 +19,7 @@
-- param max-warnings:string=1
-// We should be able to resolve both e and n, using the edge direction.
-SET `graphix.resolver` "inference-based";
+// We should be able to resolve both u and n, using the negated edge label.
FROM GRAPH VERTEX (:User)
PRIMARY KEY (user_id)
AS ( FROM Yelp.Users U
@@ -39,6 +38,6 @@
DESTINATION KEY (user_id)
AS ( FROM Yelp.Reviews R
SELECT R.review_id, R.user_id )
-MATCH (u:User)-[e]->(n)
-SELECT DISTINCT LABEL(e) AS e_label,
+MATCH (u)-[e:^MADE_BY]-(n)
+SELECT DISTINCT LABEL(u) AS u_label,
LABEL(n) AS n_label;
diff --git a/asterix-graphix/src/test/resources/runtimets/queries/graphix/schema-resolution/schema-resolution.8.query.sqlpp b/asterix-graphix/src/test/resources/runtimets/queries/graphix/schema-resolution/schema-resolution.8.query.sqlpp
new file mode 100644
index 0000000..34b03d6
--- /dev/null
+++ b/asterix-graphix/src/test/resources/runtimets/queries/graphix/schema-resolution/schema-resolution.8.query.sqlpp
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+-- param max-warnings:string=1
+
+// We should be able to resolve both subquery vertex JOINs in both directions.
+DECLARE GRAPH YelpGraph AS
+VERTEX (:User)
+ PRIMARY KEY (user_id)
+ AS ( FROM Yelp.Users U
+ SELECT U.user_id ),
+VERTEX (:Review)
+ PRIMARY KEY (review_id)
+ AS ( FROM Yelp.Reviews R
+ SELECT R.review_id ),
+EDGE (:User)-[:FRIENDS_WITH]->(:User)
+ SOURCE KEY (user_id)
+ DESTINATION KEY (friend)
+ AS ( FROM Yelp.Friends F
+ SELECT F.user_id, F.friend ),
+EDGE (:Review)-[:MADE_BY]->(:User)
+ SOURCE KEY (review_id)
+ DESTINATION KEY (user_id)
+ AS ( FROM Yelp.Reviews R
+ SELECT R.review_id, R.user_id );
+
+FROM GRAPH YelpGraph
+MATCH (u)->(r)
+WHERE EXISTS ( FROM GRAPH YelpGraph
+ MATCH (u:User)
+ WHERE u.user_id = 1
+ SELECT VALUE 1 )
+SELECT DISTINCT LABEL(u) AS u_label,
+ LABEL(r) AS r_label
+
+UNION ALL
+
+FROM GRAPH YelpGraph
+MATCH (u:User)->(r)
+WHERE EXISTS ( FROM GRAPH YelpGraph
+ MATCH (u)
+ WHERE u.user_id = 1
+ SELECT VALUE 1 )
+SELECT DISTINCT LABEL(u) AS u_label,
+ LABEL(r) AS r_label;
+
diff --git a/asterix-graphix/src/test/resources/runtimets/queries/graphix/scope-checking/scope-checking.1.ddl.sqlpp b/asterix-graphix/src/test/resources/runtimets/queries/graphix/scope-validation/scope-validation.1.ddl.sqlpp
similarity index 100%
copy from asterix-graphix/src/test/resources/runtimets/queries/graphix/scope-checking/scope-checking.1.ddl.sqlpp
copy to asterix-graphix/src/test/resources/runtimets/queries/graphix/scope-validation/scope-validation.1.ddl.sqlpp
diff --git a/asterix-graphix/src/test/resources/runtimets/queries/graphix/scope-checking/scope-checking.2.update.sqlpp b/asterix-graphix/src/test/resources/runtimets/queries/graphix/scope-validation/scope-validation.2.update.sqlpp
similarity index 100%
copy from asterix-graphix/src/test/resources/runtimets/queries/graphix/scope-checking/scope-checking.2.update.sqlpp
copy to asterix-graphix/src/test/resources/runtimets/queries/graphix/scope-validation/scope-validation.2.update.sqlpp
diff --git a/asterix-graphix/src/test/resources/runtimets/queries/graphix/scope-checking/scope-checking.7.query.sqlpp b/asterix-graphix/src/test/resources/runtimets/queries/graphix/scope-validation/scope-validation.3.query.sqlpp
similarity index 100%
rename from asterix-graphix/src/test/resources/runtimets/queries/graphix/scope-checking/scope-checking.7.query.sqlpp
rename to asterix-graphix/src/test/resources/runtimets/queries/graphix/scope-validation/scope-validation.3.query.sqlpp
diff --git a/asterix-graphix/src/test/resources/runtimets/queries/graphix/scope-checking/scope-checking.8.query.sqlpp b/asterix-graphix/src/test/resources/runtimets/queries/graphix/scope-validation/scope-validation.4.query.sqlpp
similarity index 100%
rename from asterix-graphix/src/test/resources/runtimets/queries/graphix/scope-checking/scope-checking.8.query.sqlpp
rename to asterix-graphix/src/test/resources/runtimets/queries/graphix/scope-validation/scope-validation.4.query.sqlpp
diff --git a/asterix-graphix/src/test/resources/runtimets/queries/graphix/scope-checking/scope-checking.3.query.sqlpp b/asterix-graphix/src/test/resources/runtimets/queries/graphix/simple-1-edge/simple-1-edge.6.query.sqlpp
similarity index 63%
copy from asterix-graphix/src/test/resources/runtimets/queries/graphix/scope-checking/scope-checking.3.query.sqlpp
copy to asterix-graphix/src/test/resources/runtimets/queries/graphix/simple-1-edge/simple-1-edge.6.query.sqlpp
index 8122ce1..ecec02d 100644
--- a/asterix-graphix/src/test/resources/runtimets/queries/graphix/scope-checking/scope-checking.3.query.sqlpp
+++ b/asterix-graphix/src/test/resources/runtimets/queries/graphix/simple-1-edge/simple-1-edge.6.query.sqlpp
@@ -17,7 +17,8 @@
* under the License.
*/
-// Subquery expressing anti-join of patterns.
+// We have a single edge with a filter expression on the User vertex.
+LET startingUserID = 1
FROM GRAPH VERTEX (:User)
PRIMARY KEY (user_id)
AS Yelp.Users,
@@ -26,17 +27,11 @@
AS Yelp.Reviews,
EDGE (:Review)-[:MADE_BY]->(:User)
SOURCE KEY (review_id)
- DESTINATION KEY (user_id)
+ DESTINATION KEY (review_user_id)
AS ( FROM Yelp.Reviews R
- SELECT R.review_id, R.user_id )
-MATCH (u:User)<-(r)
-WHERE NOT EXISTS ( FROM GRAPH VERTEX (:User)
- PRIMARY KEY (user_id)
- AS ( FROM Yelp.Users U
- WHERE U.user_id = 1
- SELECT VALUE U )
- MATCH (innerU:User)
- WHERE innerU = u
- SELECT VALUE 1 )
-SELECT u.user_id
-ORDER BY u.user_id;
\ No newline at end of file
+ SELECT R.review_user_id, R.review_id )
+MATCH (u:User WHERE u.user_id = startingUserID)<-[:MADE_BY]-(r:Review)
+SELECT u.user_id,
+ r.review_id
+ORDER BY u.user_id,
+ r.review_id;
diff --git a/asterix-graphix/src/test/resources/runtimets/queries/graphix/variable-sub-path/variable-sub-path.5.update.sqlpp b/asterix-graphix/src/test/resources/runtimets/queries/graphix/variable-sub-path/variable-sub-path.5.update.sqlpp
new file mode 100644
index 0000000..fdddf8d
--- /dev/null
+++ b/asterix-graphix/src/test/resources/runtimets/queries/graphix/variable-sub-path/variable-sub-path.5.update.sqlpp
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+USE Yelp;
+
+DELETE FROM Users;
+DELETE FROM Friends;
+
+INSERT INTO Users [
+ { "user_id": 1 },
+ { "user_id": 2 },
+ { "user_id": 3 },
+ { "user_id": 4 }
+];
+
+INSERT INTO Friends [
+ { "user_id": 1, "friend": 2 },
+ { "user_id": 2, "friend": 3 },
+ { "user_id": 3, "friend": 4 },
+ { "user_id": 1, "friend": 3 }
+];
diff --git a/asterix-graphix/src/test/resources/runtimets/queries/graphix/scope-checking/scope-checking.5.query.sqlpp b/asterix-graphix/src/test/resources/runtimets/queries/graphix/variable-sub-path/variable-sub-path.6.query.sqlpp
similarity index 97%
rename from asterix-graphix/src/test/resources/runtimets/queries/graphix/scope-checking/scope-checking.5.query.sqlpp
rename to asterix-graphix/src/test/resources/runtimets/queries/graphix/variable-sub-path/variable-sub-path.6.query.sqlpp
index c0c8d48..91bbdfa 100644
--- a/asterix-graphix/src/test/resources/runtimets/queries/graphix/scope-checking/scope-checking.5.query.sqlpp
+++ b/asterix-graphix/src/test/resources/runtimets/queries/graphix/variable-sub-path/variable-sub-path.6.query.sqlpp
@@ -26,7 +26,7 @@
DESTINATION KEY (friend)
AS ( FROM Yelp.Friends F
SELECT VALUE F )
-MATCH (u1)-[:{1,3}]->(u2) AS p
+MATCH (u1)-[{1,3}]->(u2) AS p
GROUP BY u1, u2
GROUP AS g
LET shortestPath = ( FROM g AS gi
diff --git a/asterix-graphix/src/test/resources/runtimets/queries/graphix/scope-checking/scope-checking.6.query.sqlpp b/asterix-graphix/src/test/resources/runtimets/queries/graphix/variable-sub-path/variable-sub-path.7.query.sqlpp
similarity index 94%
rename from asterix-graphix/src/test/resources/runtimets/queries/graphix/scope-checking/scope-checking.6.query.sqlpp
rename to asterix-graphix/src/test/resources/runtimets/queries/graphix/variable-sub-path/variable-sub-path.7.query.sqlpp
index 62e6a83..99c8c02 100644
--- a/asterix-graphix/src/test/resources/runtimets/queries/graphix/scope-checking/scope-checking.6.query.sqlpp
+++ b/asterix-graphix/src/test/resources/runtimets/queries/graphix/variable-sub-path/variable-sub-path.7.query.sqlpp
@@ -17,6 +17,7 @@
* under the License.
*/
+// Subquery + GROUP BY expressing (bounded) shortest-path.
// Subquery + GROUP BY expressing (bounded) shortest-path, using aliases.
FROM GRAPH VERTEX (:User)
PRIMARY KEY (user_id)
@@ -26,7 +27,7 @@
DESTINATION KEY (friend)
AS ( FROM Yelp.Friends F
SELECT VALUE F )
-MATCH (u1)-[:{1,3}]->(u2) AS p
+MATCH (u1)-[{1,3}]->(u2) AS p
LET pathHopCount = PATH_HOP_COUNT(p),
pathVertices = PATH_VERTICES(p),
myUser1 = u1,
diff --git a/asterix-graphix/src/test/resources/runtimets/results/graphix/scope-checking/scope-checking.3.adm b/asterix-graphix/src/test/resources/runtimets/results/graphix/correlated-vertex-join/correlated-vertex-join.3.adm
similarity index 100%
rename from asterix-graphix/src/test/resources/runtimets/results/graphix/scope-checking/scope-checking.3.adm
rename to asterix-graphix/src/test/resources/runtimets/results/graphix/correlated-vertex-join/correlated-vertex-join.3.adm
diff --git a/asterix-graphix/src/test/resources/runtimets/results/graphix/scope-checking/scope-checking.4.adm b/asterix-graphix/src/test/resources/runtimets/results/graphix/correlated-vertex-join/correlated-vertex-join.4.adm
similarity index 100%
rename from asterix-graphix/src/test/resources/runtimets/results/graphix/scope-checking/scope-checking.4.adm
rename to asterix-graphix/src/test/resources/runtimets/results/graphix/correlated-vertex-join/correlated-vertex-join.4.adm
diff --git a/asterix-graphix/src/test/resources/runtimets/results/graphix/scope-checking/scope-checking.4.adm b/asterix-graphix/src/test/resources/runtimets/results/graphix/correlated-vertex-join/correlated-vertex-join.5.adm
similarity index 100%
copy from asterix-graphix/src/test/resources/runtimets/results/graphix/scope-checking/scope-checking.4.adm
copy to asterix-graphix/src/test/resources/runtimets/results/graphix/correlated-vertex-join/correlated-vertex-join.5.adm
diff --git a/asterix-graphix/src/test/resources/runtimets/results/graphix/graphix-functions/graphix-functions.3.adm b/asterix-graphix/src/test/resources/runtimets/results/graphix/graphix-functions/graphix-functions.3.adm
index c514419..47003ca 100644
--- a/asterix-graphix/src/test/resources/runtimets/results/graphix/graphix-functions/graphix-functions.3.adm
+++ b/asterix-graphix/src/test/resources/runtimets/results/graphix/graphix-functions/graphix-functions.3.adm
@@ -1,8 +1,8 @@
-{ "vertexLabel": "Review", "vertexDetail": { "ElementLabel": "Review", "VertexKey": [ "A" ] } }
-{ "vertexLabel": "Review", "vertexDetail": { "ElementLabel": "Review", "VertexKey": [ "B" ] } }
-{ "vertexLabel": "User", "vertexDetail": { "ElementLabel": "User", "VertexKey": [ 1 ] } }
-{ "vertexLabel": "User", "vertexDetail": { "ElementLabel": "User", "VertexKey": [ 2 ] } }
-{ "vertexLabel": "User", "vertexDetail": { "ElementLabel": "User", "VertexKey": [ 3 ] } }
-{ "vertexLabel": "User", "vertexDetail": { "ElementLabel": "User", "VertexKey": [ 4 ] } }
-{ "vertexLabel": "User", "vertexDetail": { "ElementLabel": "User", "VertexKey": [ 5 ] } }
-{ "vertexLabel": "User", "vertexDetail": { "ElementLabel": "User", "VertexKey": [ 6 ] } }
\ No newline at end of file
+{ "elementLabel": "Review", "vertexDetail": { "ElementLabel": "Review", "VertexKey": [ "A" ] } }
+{ "elementLabel": "Review", "vertexDetail": { "ElementLabel": "Review", "VertexKey": [ "B" ] } }
+{ "elementLabel": "User", "vertexDetail": { "ElementLabel": "User", "VertexKey": [ 1 ] } }
+{ "elementLabel": "User", "vertexDetail": { "ElementLabel": "User", "VertexKey": [ 2 ] } }
+{ "elementLabel": "User", "vertexDetail": { "ElementLabel": "User", "VertexKey": [ 3 ] } }
+{ "elementLabel": "User", "vertexDetail": { "ElementLabel": "User", "VertexKey": [ 4 ] } }
+{ "elementLabel": "User", "vertexDetail": { "ElementLabel": "User", "VertexKey": [ 5 ] } }
+{ "elementLabel": "User", "vertexDetail": { "ElementLabel": "User", "VertexKey": [ 6 ] } }
\ No newline at end of file
diff --git a/asterix-graphix/src/test/resources/runtimets/results/graphix/graphix-functions/graphix-functions.4.adm b/asterix-graphix/src/test/resources/runtimets/results/graphix/graphix-functions/graphix-functions.4.adm
index c81b251..bfe59dc 100644
--- a/asterix-graphix/src/test/resources/runtimets/results/graphix/graphix-functions/graphix-functions.4.adm
+++ b/asterix-graphix/src/test/resources/runtimets/results/graphix/graphix-functions/graphix-functions.4.adm
@@ -1,14 +1,14 @@
-{ "direction": "LEFT_TO_RIGHT", "edgeLabel": "FRIENDS_WITH", "edgeDetail": { "ElementLabel": "FRIENDS_WITH", "EdgeDirection": "LEFT_TO_RIGHT", "SourceKey": [ 1 ], "DestinationKey": [ 2 ] }, "n1Label": "User", "n2Label": "User", "sourceVertexLabel": "User", "destVertexLabel": "User" }
-{ "direction": "LEFT_TO_RIGHT", "edgeLabel": "FRIENDS_WITH", "edgeDetail": { "ElementLabel": "FRIENDS_WITH", "EdgeDirection": "LEFT_TO_RIGHT", "SourceKey": [ 2 ], "DestinationKey": [ 3 ] }, "n1Label": "User", "n2Label": "User", "sourceVertexLabel": "User", "destVertexLabel": "User" }
-{ "direction": "LEFT_TO_RIGHT", "edgeLabel": "FRIENDS_WITH", "edgeDetail": { "ElementLabel": "FRIENDS_WITH", "EdgeDirection": "LEFT_TO_RIGHT", "SourceKey": [ 3 ], "DestinationKey": [ 4 ] }, "n1Label": "User", "n2Label": "User", "sourceVertexLabel": "User", "destVertexLabel": "User" }
-{ "direction": "LEFT_TO_RIGHT", "edgeLabel": "FRIENDS_WITH", "edgeDetail": { "ElementLabel": "FRIENDS_WITH", "EdgeDirection": "LEFT_TO_RIGHT", "SourceKey": [ 4 ], "DestinationKey": [ 5 ] }, "n1Label": "User", "n2Label": "User", "sourceVertexLabel": "User", "destVertexLabel": "User" }
-{ "direction": "LEFT_TO_RIGHT", "edgeLabel": "FRIENDS_WITH", "edgeDetail": { "ElementLabel": "FRIENDS_WITH", "EdgeDirection": "LEFT_TO_RIGHT", "SourceKey": [ 5 ], "DestinationKey": [ 6 ] }, "n1Label": "User", "n2Label": "User", "sourceVertexLabel": "User", "destVertexLabel": "User" }
-{ "direction": "LEFT_TO_RIGHT", "edgeLabel": "MADE_BY", "edgeDetail": { "ElementLabel": "MADE_BY", "EdgeDirection": "LEFT_TO_RIGHT", "SourceKey": [ "A" ], "DestinationKey": [ 1 ] }, "n1Label": "Review", "n2Label": "User", "sourceVertexLabel": "Review", "destVertexLabel": "User" }
-{ "direction": "LEFT_TO_RIGHT", "edgeLabel": "MADE_BY", "edgeDetail": { "ElementLabel": "MADE_BY", "EdgeDirection": "LEFT_TO_RIGHT", "SourceKey": [ "B" ], "DestinationKey": [ 2 ] }, "n1Label": "Review", "n2Label": "User", "sourceVertexLabel": "Review", "destVertexLabel": "User" }
-{ "direction": "RIGHT_TO_LEFT", "edgeLabel": "FRIENDS_WITH", "edgeDetail": { "ElementLabel": "FRIENDS_WITH", "EdgeDirection": "RIGHT_TO_LEFT", "SourceKey": [ 1 ], "DestinationKey": [ 2 ] }, "n1Label": "User", "n2Label": "User", "sourceVertexLabel": "User", "destVertexLabel": "User" }
-{ "direction": "RIGHT_TO_LEFT", "edgeLabel": "FRIENDS_WITH", "edgeDetail": { "ElementLabel": "FRIENDS_WITH", "EdgeDirection": "RIGHT_TO_LEFT", "SourceKey": [ 2 ], "DestinationKey": [ 3 ] }, "n1Label": "User", "n2Label": "User", "sourceVertexLabel": "User", "destVertexLabel": "User" }
-{ "direction": "RIGHT_TO_LEFT", "edgeLabel": "FRIENDS_WITH", "edgeDetail": { "ElementLabel": "FRIENDS_WITH", "EdgeDirection": "RIGHT_TO_LEFT", "SourceKey": [ 3 ], "DestinationKey": [ 4 ] }, "n1Label": "User", "n2Label": "User", "sourceVertexLabel": "User", "destVertexLabel": "User" }
-{ "direction": "RIGHT_TO_LEFT", "edgeLabel": "FRIENDS_WITH", "edgeDetail": { "ElementLabel": "FRIENDS_WITH", "EdgeDirection": "RIGHT_TO_LEFT", "SourceKey": [ 4 ], "DestinationKey": [ 5 ] }, "n1Label": "User", "n2Label": "User", "sourceVertexLabel": "User", "destVertexLabel": "User" }
-{ "direction": "RIGHT_TO_LEFT", "edgeLabel": "FRIENDS_WITH", "edgeDetail": { "ElementLabel": "FRIENDS_WITH", "EdgeDirection": "RIGHT_TO_LEFT", "SourceKey": [ 5 ], "DestinationKey": [ 6 ] }, "n1Label": "User", "n2Label": "User", "sourceVertexLabel": "User", "destVertexLabel": "User" }
-{ "direction": "RIGHT_TO_LEFT", "edgeLabel": "MADE_BY", "edgeDetail": { "ElementLabel": "MADE_BY", "EdgeDirection": "RIGHT_TO_LEFT", "SourceKey": [ "A" ], "DestinationKey": [ 1 ] }, "n1Label": "User", "n2Label": "Review", "sourceVertexLabel": "Review", "destVertexLabel": "User" }
-{ "direction": "RIGHT_TO_LEFT", "edgeLabel": "MADE_BY", "edgeDetail": { "ElementLabel": "MADE_BY", "EdgeDirection": "RIGHT_TO_LEFT", "SourceKey": [ "B" ], "DestinationKey": [ 2 ] }, "n1Label": "User", "n2Label": "Review", "sourceVertexLabel": "Review", "destVertexLabel": "User" }
\ No newline at end of file
+{ "direction": "LEFT_TO_RIGHT", "edgeLabel": "FRIENDS_WITH", "edgeDetail": { "ElementLabel": "FRIENDS_WITH", "EdgeDirection": "LEFT_TO_RIGHT", "SourceKey": [ 1 ], "DestinationKey": [ 2 ] }, "n1Label": "User", "n2Label": "User", "sourceElementLabel": "User", "destElementLabel": "User" }
+{ "direction": "LEFT_TO_RIGHT", "edgeLabel": "FRIENDS_WITH", "edgeDetail": { "ElementLabel": "FRIENDS_WITH", "EdgeDirection": "LEFT_TO_RIGHT", "SourceKey": [ 2 ], "DestinationKey": [ 3 ] }, "n1Label": "User", "n2Label": "User", "sourceElementLabel": "User", "destElementLabel": "User" }
+{ "direction": "LEFT_TO_RIGHT", "edgeLabel": "FRIENDS_WITH", "edgeDetail": { "ElementLabel": "FRIENDS_WITH", "EdgeDirection": "LEFT_TO_RIGHT", "SourceKey": [ 3 ], "DestinationKey": [ 4 ] }, "n1Label": "User", "n2Label": "User", "sourceElementLabel": "User", "destElementLabel": "User" }
+{ "direction": "LEFT_TO_RIGHT", "edgeLabel": "FRIENDS_WITH", "edgeDetail": { "ElementLabel": "FRIENDS_WITH", "EdgeDirection": "LEFT_TO_RIGHT", "SourceKey": [ 4 ], "DestinationKey": [ 5 ] }, "n1Label": "User", "n2Label": "User", "sourceElementLabel": "User", "destElementLabel": "User" }
+{ "direction": "LEFT_TO_RIGHT", "edgeLabel": "FRIENDS_WITH", "edgeDetail": { "ElementLabel": "FRIENDS_WITH", "EdgeDirection": "LEFT_TO_RIGHT", "SourceKey": [ 5 ], "DestinationKey": [ 6 ] }, "n1Label": "User", "n2Label": "User", "sourceElementLabel": "User", "destElementLabel": "User" }
+{ "direction": "LEFT_TO_RIGHT", "edgeLabel": "MADE_BY", "edgeDetail": { "ElementLabel": "MADE_BY", "EdgeDirection": "LEFT_TO_RIGHT", "SourceKey": [ "A" ], "DestinationKey": [ 1 ] }, "n1Label": "Review", "n2Label": "User", "sourceElementLabel": "Review", "destElementLabel": "User" }
+{ "direction": "LEFT_TO_RIGHT", "edgeLabel": "MADE_BY", "edgeDetail": { "ElementLabel": "MADE_BY", "EdgeDirection": "LEFT_TO_RIGHT", "SourceKey": [ "B" ], "DestinationKey": [ 2 ] }, "n1Label": "Review", "n2Label": "User", "sourceElementLabel": "Review", "destElementLabel": "User" }
+{ "direction": "RIGHT_TO_LEFT", "edgeLabel": "FRIENDS_WITH", "edgeDetail": { "ElementLabel": "FRIENDS_WITH", "EdgeDirection": "RIGHT_TO_LEFT", "SourceKey": [ 1 ], "DestinationKey": [ 2 ] }, "n1Label": "User", "n2Label": "User", "sourceElementLabel": "User", "destElementLabel": "User" }
+{ "direction": "RIGHT_TO_LEFT", "edgeLabel": "FRIENDS_WITH", "edgeDetail": { "ElementLabel": "FRIENDS_WITH", "EdgeDirection": "RIGHT_TO_LEFT", "SourceKey": [ 2 ], "DestinationKey": [ 3 ] }, "n1Label": "User", "n2Label": "User", "sourceElementLabel": "User", "destElementLabel": "User" }
+{ "direction": "RIGHT_TO_LEFT", "edgeLabel": "FRIENDS_WITH", "edgeDetail": { "ElementLabel": "FRIENDS_WITH", "EdgeDirection": "RIGHT_TO_LEFT", "SourceKey": [ 3 ], "DestinationKey": [ 4 ] }, "n1Label": "User", "n2Label": "User", "sourceElementLabel": "User", "destElementLabel": "User" }
+{ "direction": "RIGHT_TO_LEFT", "edgeLabel": "FRIENDS_WITH", "edgeDetail": { "ElementLabel": "FRIENDS_WITH", "EdgeDirection": "RIGHT_TO_LEFT", "SourceKey": [ 4 ], "DestinationKey": [ 5 ] }, "n1Label": "User", "n2Label": "User", "sourceElementLabel": "User", "destElementLabel": "User" }
+{ "direction": "RIGHT_TO_LEFT", "edgeLabel": "FRIENDS_WITH", "edgeDetail": { "ElementLabel": "FRIENDS_WITH", "EdgeDirection": "RIGHT_TO_LEFT", "SourceKey": [ 5 ], "DestinationKey": [ 6 ] }, "n1Label": "User", "n2Label": "User", "sourceElementLabel": "User", "destElementLabel": "User" }
+{ "direction": "RIGHT_TO_LEFT", "edgeLabel": "MADE_BY", "edgeDetail": { "ElementLabel": "MADE_BY", "EdgeDirection": "RIGHT_TO_LEFT", "SourceKey": [ "A" ], "DestinationKey": [ 1 ] }, "n1Label": "User", "n2Label": "Review", "sourceElementLabel": "Review", "destElementLabel": "User" }
+{ "direction": "RIGHT_TO_LEFT", "edgeLabel": "MADE_BY", "edgeDetail": { "ElementLabel": "MADE_BY", "EdgeDirection": "RIGHT_TO_LEFT", "SourceKey": [ "B" ], "DestinationKey": [ 2 ] }, "n1Label": "User", "n2Label": "Review", "sourceElementLabel": "Review", "destElementLabel": "User" }
\ No newline at end of file
diff --git a/asterix-graphix/src/test/resources/runtimets/results/graphix/same-edge-label/same-edge-label.3.adm b/asterix-graphix/src/test/resources/runtimets/results/graphix/same-edge-label/same-edge-label.3.adm
new file mode 100644
index 0000000..42acc6b
--- /dev/null
+++ b/asterix-graphix/src/test/resources/runtimets/results/graphix/same-edge-label/same-edge-label.3.adm
@@ -0,0 +1,10 @@
+{ "u_record": { "review_id": "A" }, "v_user_id": 1 }
+{ "u_record": { "review_id": "B" }, "v_user_id": 1 }
+{ "u_record": { "review_id": "C" }, "v_user_id": 1 }
+{ "u_record": { "review_id": "D" }, "v_user_id": 2 }
+{ "u_record": { "review_id": "E" }, "v_user_id": 3 }
+{ "u_record": { "review_id": "F" }, "v_user_id": 4 }
+{ "u_record": { "user_id": 1 }, "v_user_id": 2 }
+{ "u_record": { "user_id": 1 }, "v_user_id": 3 }
+{ "u_record": { "user_id": 2 }, "v_user_id": 3 }
+{ "u_record": { "user_id": 3 }, "v_user_id": 4 }
\ No newline at end of file
diff --git a/asterix-graphix/src/test/resources/runtimets/results/graphix/inference-resolution/inference-resolution.3.adm b/asterix-graphix/src/test/resources/runtimets/results/graphix/schema-resolution/schema-resolution.3.adm
similarity index 100%
rename from asterix-graphix/src/test/resources/runtimets/results/graphix/inference-resolution/inference-resolution.3.adm
rename to asterix-graphix/src/test/resources/runtimets/results/graphix/schema-resolution/schema-resolution.3.adm
diff --git a/asterix-graphix/src/test/resources/runtimets/results/graphix/inference-resolution/inference-resolution.4.adm b/asterix-graphix/src/test/resources/runtimets/results/graphix/schema-resolution/schema-resolution.4.adm
similarity index 100%
rename from asterix-graphix/src/test/resources/runtimets/results/graphix/inference-resolution/inference-resolution.4.adm
rename to asterix-graphix/src/test/resources/runtimets/results/graphix/schema-resolution/schema-resolution.4.adm
diff --git a/asterix-graphix/src/test/resources/runtimets/results/graphix/inference-resolution/inference-resolution.5.adm b/asterix-graphix/src/test/resources/runtimets/results/graphix/schema-resolution/schema-resolution.5.adm
similarity index 100%
rename from asterix-graphix/src/test/resources/runtimets/results/graphix/inference-resolution/inference-resolution.5.adm
rename to asterix-graphix/src/test/resources/runtimets/results/graphix/schema-resolution/schema-resolution.5.adm
diff --git a/asterix-graphix/src/test/resources/runtimets/results/graphix/inference-resolution/inference-resolution.6.adm b/asterix-graphix/src/test/resources/runtimets/results/graphix/schema-resolution/schema-resolution.6.adm
similarity index 100%
rename from asterix-graphix/src/test/resources/runtimets/results/graphix/inference-resolution/inference-resolution.6.adm
rename to asterix-graphix/src/test/resources/runtimets/results/graphix/schema-resolution/schema-resolution.6.adm
diff --git a/asterix-graphix/src/test/resources/runtimets/results/graphix/schema-resolution/schema-resolution.7.adm b/asterix-graphix/src/test/resources/runtimets/results/graphix/schema-resolution/schema-resolution.7.adm
new file mode 100644
index 0000000..1588f9f
--- /dev/null
+++ b/asterix-graphix/src/test/resources/runtimets/results/graphix/schema-resolution/schema-resolution.7.adm
@@ -0,0 +1 @@
+{ "u_label": "User", "n_label": "User" }
\ No newline at end of file
diff --git a/asterix-graphix/src/test/resources/runtimets/results/graphix/schema-resolution/schema-resolution.8.adm b/asterix-graphix/src/test/resources/runtimets/results/graphix/schema-resolution/schema-resolution.8.adm
new file mode 100644
index 0000000..2677371
--- /dev/null
+++ b/asterix-graphix/src/test/resources/runtimets/results/graphix/schema-resolution/schema-resolution.8.adm
@@ -0,0 +1,2 @@
+{ "u_label": "User", "r_label": "User" }
+{ "u_label": "User", "r_label": "User" }
\ No newline at end of file
diff --git a/asterix-graphix/src/test/resources/runtimets/results/graphix/scope-checking/scope-checking.8.adm b/asterix-graphix/src/test/resources/runtimets/results/graphix/scope-checking/scope-checking.8.adm
deleted file mode 100644
index 9b24dd0..0000000
--- a/asterix-graphix/src/test/resources/runtimets/results/graphix/scope-checking/scope-checking.8.adm
+++ /dev/null
@@ -1,6 +0,0 @@
-{ "user_id": 1, "review_id": "A" }
-{ "user_id": 1, "review_id": "B" }
-{ "user_id": 1, "review_id": "C" }
-{ "user_id": 2, "review_id": "D" }
-{ "user_id": 3, "review_id": "E" }
-{ "user_id": 4, "review_id": "F" }
\ No newline at end of file
diff --git a/asterix-graphix/src/test/resources/runtimets/results/graphix/scope-checking/scope-checking.7.adm b/asterix-graphix/src/test/resources/runtimets/results/graphix/scope-validation/scope-validation.3.adm
similarity index 100%
rename from asterix-graphix/src/test/resources/runtimets/results/graphix/scope-checking/scope-checking.7.adm
rename to asterix-graphix/src/test/resources/runtimets/results/graphix/scope-validation/scope-validation.3.adm
diff --git a/asterix-graphix/src/test/resources/runtimets/results/graphix/scope-checking/scope-checking.7.adm b/asterix-graphix/src/test/resources/runtimets/results/graphix/scope-validation/scope-validation.4.adm
similarity index 100%
copy from asterix-graphix/src/test/resources/runtimets/results/graphix/scope-checking/scope-checking.7.adm
copy to asterix-graphix/src/test/resources/runtimets/results/graphix/scope-validation/scope-validation.4.adm
diff --git a/asterix-graphix/src/test/resources/runtimets/results/graphix/simple-1-edge/simple-1-edge.6.adm b/asterix-graphix/src/test/resources/runtimets/results/graphix/simple-1-edge/simple-1-edge.6.adm
new file mode 100644
index 0000000..2a5d87f
--- /dev/null
+++ b/asterix-graphix/src/test/resources/runtimets/results/graphix/simple-1-edge/simple-1-edge.6.adm
@@ -0,0 +1,2 @@
+{ "user_id": 1, "review_id": "A" }
+{ "user_id": 1, "review_id": "B" }
\ No newline at end of file
diff --git a/asterix-graphix/src/test/resources/runtimets/results/graphix/scope-checking/scope-checking.6.adm b/asterix-graphix/src/test/resources/runtimets/results/graphix/variable-sub-path/variable-sub-path.6.adm
similarity index 100%
rename from asterix-graphix/src/test/resources/runtimets/results/graphix/scope-checking/scope-checking.6.adm
rename to asterix-graphix/src/test/resources/runtimets/results/graphix/variable-sub-path/variable-sub-path.6.adm
diff --git a/asterix-graphix/src/test/resources/runtimets/results/graphix/scope-checking/scope-checking.5.adm b/asterix-graphix/src/test/resources/runtimets/results/graphix/variable-sub-path/variable-sub-path.7.adm
similarity index 100%
rename from asterix-graphix/src/test/resources/runtimets/results/graphix/scope-checking/scope-checking.5.adm
rename to asterix-graphix/src/test/resources/runtimets/results/graphix/variable-sub-path/variable-sub-path.7.adm
diff --git a/asterix-graphix/src/test/resources/runtimets/testsuite.xml b/asterix-graphix/src/test/resources/runtimets/testsuite.xml
index a5ea9fc..50abf0c 100644
--- a/asterix-graphix/src/test/resources/runtimets/testsuite.xml
+++ b/asterix-graphix/src/test/resources/runtimets/testsuite.xml
@@ -20,6 +20,13 @@
ResultOffsetPath="results"
QueryOffsetPath="queries"
QueryFileExtension=".sqlpp">
+ <test-group name="correlated-vertex-join">
+ <test-case FilePath="graphix">
+ <compilation-unit name="correlated-vertex-join">
+ <output-dir compare="Text">correlated-vertex-join</output-dir>
+ </compilation-unit>
+ </test-case>
+ </test-group>
<test-group name="create-drop-error">
<test-case FilePath="graphix">
<compilation-unit name="create-drop-error">
@@ -42,10 +49,12 @@
</test-case>
</test-group>
<test-group name="dangling-vertices">
- <test-case FilePath="graphix" check-warnings="true">
+ <!--<test-case FilePath="graphix" check-warnings="true">-->
+ <test-case FilePath="graphix" check-warnings="false">
<compilation-unit name="dangling-vertices">
<output-dir compare="Text">dangling-vertices</output-dir>
- <expected-warn>Potential disconnected pattern encountered! A CROSS-JOIN has been introduced.</expected-warn>
+ <!--<expected-warn>Disconnected pattern encountered! A CROSS-JOIN may been introduced.</expected-warn>-->
+ <!--<expected-warn>Encountered a cross product join</expected-warn>-->
</compilation-unit>
</test-case>
</test-group>
@@ -70,13 +79,6 @@
</compilation-unit>
</test-case>
</test-group>
- <test-group name="inference-resolution">
- <test-case FilePath="graphix" check-warnings="true">
- <compilation-unit name="inference-resolution">
- <output-dir compare="Text">inference-resolution</output-dir>
- </compilation-unit>
- </test-case>
- </test-group>
<test-group name="left-match">
<test-case FilePath="graphix">
<compilation-unit name="left-match">
@@ -99,6 +101,7 @@
<expected-error>Cannot resolve alias reference for undefined identifier invalidVariable</expected-error>
<expected-error>Cannot resolve alias reference for undefined identifier invalidVariable</expected-error>
<expected-error>Cannot resolve alias reference for undefined identifier invalidVariable</expected-error>
+ <expected-error>Encountered graph element that does not conform the queried graph schema!</expected-error>
</compilation-unit>
</test-case>
</test-group>
@@ -109,10 +112,17 @@
</compilation-unit>
</test-case>
</test-group>
- <test-group name="scope-checking">
+ <test-group name="schema-resolution">
+ <test-case FilePath="graphix" check-warnings="true">
+ <compilation-unit name="schema-resolution">
+ <output-dir compare="Text">schema-resolution</output-dir>
+ </compilation-unit>
+ </test-case>
+ </test-group>
+ <test-group name="scope-validation">
<test-case FilePath="graphix">
- <compilation-unit name="scope-checking">
- <output-dir compare="Text">scope-checking</output-dir>
+ <compilation-unit name="scope-validation">
+ <output-dir compare="Text">scope-validation</output-dir>
</compilation-unit>
</test-case>
</test-group>