[NO-ISSUE][GRAPHIX] Adding a pure-rewrite version of Graphix.
Details:
- Users can create and delete managed graphs w/ CREATE GRAPH and DROP
GRAPH. These will raise an error if a user tries to drop one of their
dependents (and vice-versa).
- Users can introduce a set of variable bindings before UNNEST and JOIN
clauses using the MATCH clause, which will iterate over all "matched"
graph patterns. The MATCH clause also includes a "LEFT" variant.
- Graph edge patterns can be formulated as path finding queries, where a
user can specify the range of hops between the two vertices of the edge
pattern.
- Labels and directions can be inferred using labels and directions of
vertices within the same FROM-GRAPH-CLAUSE. A naive evaluation
strategy is used here (until we reach a fixed point).
- The initial set of Graphix functions are included.
Change-Id: I50f032ea4acc5ba46b86ae1052590a3e945c2497
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb-graph/+/16103
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Glenn Galvizo <ggalvizo@uci.edu>
diff --git a/asterix-graphix/src/test/resources/metadatats/queries/graphix/create-drop-graph/create-drop-graph.1.ddl.sqlpp b/asterix-graphix/src/test/resources/metadatats/queries/graphix/create-drop-graph/create-drop-graph.1.ddl.sqlpp
new file mode 100644
index 0000000..db8589e
--- /dev/null
+++ b/asterix-graphix/src/test/resources/metadatats/queries/graphix/create-drop-graph/create-drop-graph.1.ddl.sqlpp
@@ -0,0 +1,126 @@
+/*
+ * 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.
+ */
+
+DROP DATAVERSE Yelp IF EXISTS;
+DROP DATAVERSE Yelp_A IF EXISTS;
+DROP DATAVERSE Yelp_B IF EXISTS;
+CREATE DATAVERSE Yelp;
+CREATE DATAVERSE Yelp_A;
+CREATE DATAVERSE Yelp_B;
+
+USE Yelp_A;
+CREATE TYPE GenericType
+AS { _id: uuid };
+CREATE DATASET Businesses (GenericType)
+PRIMARY KEY _id AUTOGENERATED;
+CREATE DATASET Checkins (GenericType)
+PRIMARY KEY _id AUTOGENERATED;
+CREATE DATASET Friends (GenericType)
+PRIMARY KEY _id AUTOGENERATED;
+CREATE DATASET Reviews (GenericType)
+PRIMARY KEY _id AUTOGENERATED;
+CREATE DATASET Tips (GenericType)
+PRIMARY KEY _id AUTOGENERATED;
+CREATE DATASET Users (GenericType)
+PRIMARY KEY _id AUTOGENERATED;
+CREATE FUNCTION RelevantBusinesses()
+ { FROM Businesses B
+ WHERE B.stars > 3.5
+ SELECT B.* };
+
+USE Yelp_B;
+CREATE TYPE GenericType
+AS { _id: uuid };
+CREATE DATASET Businesses (GenericType)
+PRIMARY KEY _id AUTOGENERATED;
+CREATE DATASET Checkins (GenericType)
+PRIMARY KEY _id AUTOGENERATED;
+CREATE DATASET Friends (GenericType)
+PRIMARY KEY _id AUTOGENERATED;
+CREATE DATASET Reviews (GenericType)
+PRIMARY KEY _id AUTOGENERATED;
+CREATE DATASET Tips (GenericType)
+PRIMARY KEY _id AUTOGENERATED;
+CREATE DATASET Users (GenericType)
+PRIMARY KEY _id AUTOGENERATED;
+CREATE SYNONYM Yelpers FOR Users;
+
+USE Yelp;
+CREATE GRAPH YelpGraph_1 AS
+VERTEX (:User)
+ PRIMARY KEY (user_id)
+ AS Yelp_B.Yelpers,
+VERTEX (:Review)
+ PRIMARY KEY (review_id)
+ AS ( FROM Yelp_A.Reviews R
+ SELECT VALUE R ),
+VERTEX (:Business)
+ PRIMARY KEY (business_id)
+ AS ( FROM Yelp_A.RelevantBusinesses() B
+ SELECT VALUE B ),
+EDGE (:User)-[:FRIENDS_WITH]->(:User)
+ SOURCE KEY (user_id)
+ DESTINATION KEY (friend)
+ AS ( FROM Yelp_B.Users U
+ UNNEST U.friends F
+ SELECT U.user_id, F AS friend ),
+EDGE (:User)-[:FRIENDS_WITH]->(:User)
+ SOURCE KEY (user_id)
+ DESTINATION KEY (friend)
+ AS ( FROM Yelp_B.Friends F
+ SELECT F.* ),
+EDGE (:Review)-[:MADE_BY]->(:User)
+ SOURCE KEY (review_id)
+ DESTINATION KEY (user_id)
+ AS ( FROM Yelp_A.Reviews R
+ SELECT R.review_id, R.user_id ),
+EDGE (:Review)-[:ABOUT]->(:Business)
+ SOURCE KEY (review_id)
+ DESTINATION KEY (business_id)
+ AS ( FROM Yelp_A.Reviews R
+ SELECT R.review_id, R.business_id );
+
+CREATE GRAPH YelpGraph_2 IF NOT EXISTS AS
+VERTEX (:Review)
+ PRIMARY KEY (review_id)
+ AS ( FROM Yelp_A.Reviews R
+ SELECT VALUE R ),
+VERTEX (:Business)
+ PRIMARY KEY (business_id)
+ AS ( FROM Yelp_A.RelevantBusinesses() B
+ SELECT VALUE B ),
+EDGE (:Review)-[:ABOUT]->(:Business)
+ SOURCE KEY (review_id)
+ DESTINATION KEY (business_id)
+ AS ( FROM Yelp_A.Reviews R
+ SELECT VALUE R );
+CREATE GRAPH YelpGraph_2 IF NOT EXISTS AS
+VERTEX (:Review)
+ PRIMARY KEY (review_id)
+ AS ( FROM Yelp_A.Reviews R
+ SELECT VALUE R ),
+VERTEX (:Business)
+ PRIMARY KEY (business_id)
+ AS ( FROM Yelp_A.RelevantBusinesses() B
+ SELECT VALUE B ),
+EDGE (:Review)-[:ABOUT]->(:Business)
+ SOURCE KEY (review_id)
+ DESTINATION KEY (business_id)
+ AS ( FROM Yelp_A.Reviews R
+ SELECT VALUE R );
\ No newline at end of file
diff --git a/asterix-graphix/src/test/resources/metadatats/queries/graphix/create-drop-graph/create-drop-graph.2.query.sqlpp b/asterix-graphix/src/test/resources/metadatats/queries/graphix/create-drop-graph/create-drop-graph.2.query.sqlpp
new file mode 100644
index 0000000..ca71c1e
--- /dev/null
+++ b/asterix-graphix/src/test/resources/metadatats/queries/graphix/create-drop-graph/create-drop-graph.2.query.sqlpp
@@ -0,0 +1,30 @@
+/*
+ * 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.
+ */
+
+FROM `Metadata`.`Graph` G,
+ `Metadata`.`GraphDependency` GD,
+ GD.Dependencies D
+WHERE G.DataverseName = GD.DataverseName AND
+ G.GraphName = GD.EntityName AND
+ GD.Kind = "GRAPH"
+SELECT G.DataverseName, G.GraphName, G.Vertices, G.Edges,
+ D.DataverseName AS DependentDataverse,
+ D.EntityName AS DependentName,
+ D.Kind AS DependentKind
+ORDER BY G.DataverseName, G.GraphName, D;
\ No newline at end of file
diff --git a/asterix-graphix/src/test/resources/metadatats/queries/graphix/create-drop-graph/create-drop-graph.3.ddl.sqlpp b/asterix-graphix/src/test/resources/metadatats/queries/graphix/create-drop-graph/create-drop-graph.3.ddl.sqlpp
new file mode 100644
index 0000000..ca52d3d
--- /dev/null
+++ b/asterix-graphix/src/test/resources/metadatats/queries/graphix/create-drop-graph/create-drop-graph.3.ddl.sqlpp
@@ -0,0 +1,21 @@
+/*
+ * 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.
+ */
+
+DROP GRAPH Yelp.YelpGraph_1 IF EXISTS;
+DROP GRAPH Yelp.YelpGraph_1 IF EXISTS;
diff --git a/asterix-graphix/src/test/resources/metadatats/queries/graphix/create-drop-graph/create-drop-graph.4.query.sqlpp b/asterix-graphix/src/test/resources/metadatats/queries/graphix/create-drop-graph/create-drop-graph.4.query.sqlpp
new file mode 100644
index 0000000..ca71c1e
--- /dev/null
+++ b/asterix-graphix/src/test/resources/metadatats/queries/graphix/create-drop-graph/create-drop-graph.4.query.sqlpp
@@ -0,0 +1,30 @@
+/*
+ * 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.
+ */
+
+FROM `Metadata`.`Graph` G,
+ `Metadata`.`GraphDependency` GD,
+ GD.Dependencies D
+WHERE G.DataverseName = GD.DataverseName AND
+ G.GraphName = GD.EntityName AND
+ GD.Kind = "GRAPH"
+SELECT G.DataverseName, G.GraphName, G.Vertices, G.Edges,
+ D.DataverseName AS DependentDataverse,
+ D.EntityName AS DependentName,
+ D.Kind AS DependentKind
+ORDER BY G.DataverseName, G.GraphName, D;
\ No newline at end of file
diff --git a/asterix-graphix/src/test/resources/metadatats/queries/graphix/create-drop-graph/create-drop-graph.5.ddl.sqlpp b/asterix-graphix/src/test/resources/metadatats/queries/graphix/create-drop-graph/create-drop-graph.5.ddl.sqlpp
new file mode 100644
index 0000000..0835454
--- /dev/null
+++ b/asterix-graphix/src/test/resources/metadatats/queries/graphix/create-drop-graph/create-drop-graph.5.ddl.sqlpp
@@ -0,0 +1,52 @@
+/*
+ * 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.
+ */
+
+CREATE OR REPLACE GRAPH Yelp.YelpGraph_2 AS
+VERTEX (:User)
+ PRIMARY KEY (user_id)
+ AS Yelp_B.Yelpers,
+VERTEX (:Review)
+ PRIMARY KEY (review_id)
+ AS ( FROM Yelp_A.Reviews R
+ SELECT VALUE R ),
+VERTEX (:Business)
+ PRIMARY KEY (business_id)
+ AS ( FROM Yelp_A.RelevantBusinesses() B
+ SELECT VALUE B ),
+EDGE (:User)-[:FRIENDS_WITH]->(:User)
+ SOURCE KEY (user_id)
+ DESTINATION KEY (friend)
+ AS ( FROM Yelp_B.Users U
+ UNNEST U.friends F
+ SELECT U.user_id, F AS friend ),
+EDGE (:User)-[:FRIENDS_WITH]->(:User)
+ SOURCE KEY (user_id)
+ DESTINATION KEY (friend)
+ AS ( FROM Yelp_B.Friends F
+ SELECT F.* ),
+EDGE (:Review)-[:MADE_BY]->(:User)
+ SOURCE KEY (review_id)
+ DESTINATION KEY (user_id)
+ AS ( FROM Yelp_A.Reviews R
+ SELECT VALUE R ),
+EDGE (:Review)-[:ABOUT]->(:Business)
+ SOURCE KEY (review_id)
+ DESTINATION KEY (business_id)
+ AS ( FROM Yelp_A.Reviews R
+ SELECT VALUE R );
diff --git a/asterix-graphix/src/test/resources/metadatats/queries/graphix/create-drop-graph/create-drop-graph.6.query.sqlpp b/asterix-graphix/src/test/resources/metadatats/queries/graphix/create-drop-graph/create-drop-graph.6.query.sqlpp
new file mode 100644
index 0000000..ca71c1e
--- /dev/null
+++ b/asterix-graphix/src/test/resources/metadatats/queries/graphix/create-drop-graph/create-drop-graph.6.query.sqlpp
@@ -0,0 +1,30 @@
+/*
+ * 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.
+ */
+
+FROM `Metadata`.`Graph` G,
+ `Metadata`.`GraphDependency` GD,
+ GD.Dependencies D
+WHERE G.DataverseName = GD.DataverseName AND
+ G.GraphName = GD.EntityName AND
+ GD.Kind = "GRAPH"
+SELECT G.DataverseName, G.GraphName, G.Vertices, G.Edges,
+ D.DataverseName AS DependentDataverse,
+ D.EntityName AS DependentName,
+ D.Kind AS DependentKind
+ORDER BY G.DataverseName, G.GraphName, D;
\ No newline at end of file
diff --git a/asterix-graphix/src/test/resources/metadatats/queries/graphix/create-drop-graph/create-drop-graph.7.ddl.sqlpp b/asterix-graphix/src/test/resources/metadatats/queries/graphix/create-drop-graph/create-drop-graph.7.ddl.sqlpp
new file mode 100644
index 0000000..d846648
--- /dev/null
+++ b/asterix-graphix/src/test/resources/metadatats/queries/graphix/create-drop-graph/create-drop-graph.7.ddl.sqlpp
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ */
+
+DROP DATAVERSE Yelp;
+DROP DATAVERSE Yelp_A;
+DROP DATAVERSE Yelp_B;
\ No newline at end of file
diff --git a/asterix-graphix/src/test/resources/metadatats/queries/graphix/create-drop-graph/create-drop-graph.8.query.sqlpp b/asterix-graphix/src/test/resources/metadatats/queries/graphix/create-drop-graph/create-drop-graph.8.query.sqlpp
new file mode 100644
index 0000000..c238c7c
--- /dev/null
+++ b/asterix-graphix/src/test/resources/metadatats/queries/graphix/create-drop-graph/create-drop-graph.8.query.sqlpp
@@ -0,0 +1,31 @@
+/*
+ * 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.
+ */
+
+SELECT VALUE {
+ "graphCount": (
+ FROM `Metadata`.`Graph` G
+ WHERE G.DataverseName IN [ "Yelp", "Yelp_A", "Yelp_B" ]
+ SELECT VALUE COUNT(*)
+ )[0],
+ "dependencyCount": (
+ FROM `Metadata`.`GraphDependency` GD
+ WHERE GD.DataverseName IN [ "Yelp", "Yelp_A", "Yelp_B" ]
+ SELECT VALUE COUNT(*)
+ )[0]
+};
diff --git a/asterix-graphix/src/test/resources/metadatats/queries/graphix/on-graph-dependency/on-graph-dependency.1.ddl.sqlpp b/asterix-graphix/src/test/resources/metadatats/queries/graphix/on-graph-dependency/on-graph-dependency.1.ddl.sqlpp
new file mode 100644
index 0000000..127319a
--- /dev/null
+++ b/asterix-graphix/src/test/resources/metadatats/queries/graphix/on-graph-dependency/on-graph-dependency.1.ddl.sqlpp
@@ -0,0 +1,66 @@
+/*
+ * 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.
+ */
+
+DROP DATAVERSE Yelp IF EXISTS;
+CREATE DATAVERSE Yelp;
+USE Yelp;
+
+CREATE TYPE GenericType
+AS { _id: uuid };
+CREATE DATASET Users (GenericType)
+PRIMARY KEY _id AUTOGENERATED;
+CREATE DATASET Reviews (GenericType)
+PRIMARY KEY _id AUTOGENERATED;
+
+CREATE GRAPH YelpGraph AS
+VERTEX (:User)
+ PRIMARY KEY (user_id)
+ AS Users,
+VERTEX (:Review)
+ PRIMARY KEY (review_id)
+ AS Reviews,
+EDGE (:User)<-[:MADE_BY]-(:Review)
+ SOURCE KEY (review_id)
+ DESTINATION KEY (user_id)
+ AS ( FROM Yelp.Reviews R
+ SELECT R.review_id, R.user_id );
+
+// Create a function, view, and another graph that depend on the graph above.
+CREATE FUNCTION YelpGraphFunction ()
+ { FROM GRAPH YelpGraph
+ MATCH (u)-[]->(r)
+ SELECT u, r
+ LIMIT 1 };
+CREATE VIEW YelpGraphView AS
+ FROM GRAPH YelpGraph
+ MATCH (u:User)<-[:MADE_BY]-(:Review)
+ SELECT u.user_id
+ LIMIT 1;
+CREATE GRAPH YelpGraphGraph AS
+VERTEX (:UsersWithReviews)
+ PRIMARY KEY (user_id)
+ AS ( FROM GRAPH YelpGraph
+ MATCH (u:User)<-[:MADE_BY]-(:Review)
+ SELECT u ),
+EDGE (:UsersWithReviews)-[:FRIENDS_WITH]->(:UsersWithReviews)
+ SOURCE KEY (user_id)
+ DESTINATION KEY (best_friend)
+ AS ( FROM GRAPH YelpGraph
+ MATCH (u:User)<-[:MADE_BY]-(Review)
+ SELECT u.user_id, u.best_friend );
diff --git a/asterix-graphix/src/test/resources/metadatats/queries/graphix/on-graph-dependency/on-graph-dependency.2.query.sqlpp b/asterix-graphix/src/test/resources/metadatats/queries/graphix/on-graph-dependency/on-graph-dependency.2.query.sqlpp
new file mode 100644
index 0000000..cef0add
--- /dev/null
+++ b/asterix-graphix/src/test/resources/metadatats/queries/graphix/on-graph-dependency/on-graph-dependency.2.query.sqlpp
@@ -0,0 +1,65 @@
+/*
+ * 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.
+ */
+
+SELECT VALUE {
+ "graph": (
+ FROM `Metadata`.`Graph` G,
+ `Metadata`.`GraphDependency` GD,
+ GD.Dependencies D
+ WHERE G.DataverseName = GD.DataverseName AND
+ G.GraphName = GD.EntityName AND
+ GD.DataverseName = "Yelp" AND
+ GD.Kind = "GRAPH"
+ SELECT G.DataverseName, G.GraphName,
+ D.DataverseName AS DependentDataverse,
+ D.EntityName AS DependentName,
+ D.Kind AS DependentKind
+ ORDER BY G.DataverseName, G.GraphName, D
+ ),
+ "function": (
+ FROM `Metadata`.`Function` F,
+ `Metadata`.`GraphDependency` GD,
+ GD.Dependencies D
+ WHERE F.DataverseName = GD.DataverseName AND
+ F.Name = GD.EntityName AND
+ F.Arity = GD.EntityDetail AND
+ GD.DataverseName = "Yelp" AND
+ GD.Kind = "FUNCTION"
+ SELECT F.DataverseName, F.Name, F.Arity,
+ D.DataverseName AS DependentDataverse,
+ D.EntityName AS DependentName,
+ D.Kind AS DependentKind
+ ORDER BY F.DataverseName, F.Name, D
+ ),
+ "view": (
+ FROM `Metadata`.`Dataset` DD,
+ `Metadata`.`GraphDependency` GD,
+ GD.Dependencies D
+ WHERE DD.DataverseName = GD.DataverseName AND
+ DD.DatasetName = GD.EntityName AND
+ DD.DatasetType = "VIEW" AND
+ GD.DataverseName = "Yelp" AND
+ GD.Kind = "VIEW"
+ SELECT DD.DataverseName, DD.DatasetName,
+ D.DataverseName AS DependentDataverse,
+ D.EntityName AS DependentName,
+ D.Kind AS DependentKind
+ ORDER BY DD.DataverseName, DD.DatasetName, D
+ )
+};
diff --git a/asterix-graphix/src/test/resources/metadatats/queries/graphix/on-graph-dependency/on-graph-dependency.3.ddl.sqlpp b/asterix-graphix/src/test/resources/metadatats/queries/graphix/on-graph-dependency/on-graph-dependency.3.ddl.sqlpp
new file mode 100644
index 0000000..df554f4
--- /dev/null
+++ b/asterix-graphix/src/test/resources/metadatats/queries/graphix/on-graph-dependency/on-graph-dependency.3.ddl.sqlpp
@@ -0,0 +1,20 @@
+/*
+ * 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.
+ */
+
+DROP DATAVERSE Yelp;
diff --git a/asterix-graphix/src/test/resources/metadatats/queries/graphix/on-graph-dependency/on-graph-dependency.4.query.sqlpp b/asterix-graphix/src/test/resources/metadatats/queries/graphix/on-graph-dependency/on-graph-dependency.4.query.sqlpp
new file mode 100644
index 0000000..bbb0b64
--- /dev/null
+++ b/asterix-graphix/src/test/resources/metadatats/queries/graphix/on-graph-dependency/on-graph-dependency.4.query.sqlpp
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ */
+
+FROM `Metadata`.`GraphDependency` GD
+WHERE GD.DataverseName = "Yelp"
+SELECT VALUE COUNT(*);
diff --git a/asterix-graphix/src/test/resources/metadatats/results/graphix/create-drop-graph/create-drop-graph.2.adm b/asterix-graphix/src/test/resources/metadatats/results/graphix/create-drop-graph/create-drop-graph.2.adm
new file mode 100644
index 0000000..2e8cfe1
--- /dev/null
+++ b/asterix-graphix/src/test/resources/metadatats/results/graphix/create-drop-graph/create-drop-graph.2.adm
@@ -0,0 +1,7 @@
+{ "DataverseName": "Yelp", "GraphName": "YelpGraph_1", "Vertices": [ { "Label": "User", "Definitions": [ { "PrimaryKey": [ [ "user_id" ] ], "Body": "Yelp_B.Yelpers" } ] }, { "Label": "Review", "Definitions": [ { "PrimaryKey": [ [ "review_id" ] ], "Body": "FROM Yelp_A.Reviews R\n SELECT VALUE R" } ] }, { "Label": "Business", "Definitions": [ { "PrimaryKey": [ [ "business_id" ] ], "Body": "FROM Yelp_A.RelevantBusinesses() B\n SELECT VALUE B" } ] } ], "Edges": [ { "Label": "FRIENDS_WITH", "DestinationLabel": "User", "SourceLabel": "User", "Definitions": [ { "SourceKey": [ [ "user_id" ] ], "DestinationKey": [ [ "friend" ] ], "Body": "FROM Yelp_B.Users U\n UNNEST U.friends F\n SELECT U.user_id, F AS friend" }, { "SourceKey": [ [ "user_id" ] ], "DestinationKey": [ [ "friend" ] ], "Body": "FROM Yelp_B.Friends F\n SELECT F.*" } ] }, { "Label": "MADE_BY", "DestinationLabel": "User", "SourceLabel": "Review", "Definitions": [ { "SourceKey": [ [ "review_id" ] ], "DestinationKey": [ [ "user_id" ] ], "Body": "FROM Yelp_A.Reviews R\n SELECT R.review_id, R.user_id" } ] }, { "Label": "ABOUT", "DestinationLabel": "Business", "SourceLabel": "Review", "Definitions": [ { "SourceKey": [ [ "review_id" ] ], "DestinationKey": [ [ "business_id" ] ], "Body": "FROM Yelp_A.Reviews R\n SELECT R.review_id, R.business_id" } ] } ], "DependentDataverse": "Yelp_A", "DependentName": "RelevantBusinesses", "DependentKind": "FUNCTION" }
+{ "DataverseName": "Yelp", "GraphName": "YelpGraph_1", "Vertices": [ { "Label": "User", "Definitions": [ { "PrimaryKey": [ [ "user_id" ] ], "Body": "Yelp_B.Yelpers" } ] }, { "Label": "Review", "Definitions": [ { "PrimaryKey": [ [ "review_id" ] ], "Body": "FROM Yelp_A.Reviews R\n SELECT VALUE R" } ] }, { "Label": "Business", "Definitions": [ { "PrimaryKey": [ [ "business_id" ] ], "Body": "FROM Yelp_A.RelevantBusinesses() B\n SELECT VALUE B" } ] } ], "Edges": [ { "Label": "FRIENDS_WITH", "DestinationLabel": "User", "SourceLabel": "User", "Definitions": [ { "SourceKey": [ [ "user_id" ] ], "DestinationKey": [ [ "friend" ] ], "Body": "FROM Yelp_B.Users U\n UNNEST U.friends F\n SELECT U.user_id, F AS friend" }, { "SourceKey": [ [ "user_id" ] ], "DestinationKey": [ [ "friend" ] ], "Body": "FROM Yelp_B.Friends F\n SELECT F.*" } ] }, { "Label": "MADE_BY", "DestinationLabel": "User", "SourceLabel": "Review", "Definitions": [ { "SourceKey": [ [ "review_id" ] ], "DestinationKey": [ [ "user_id" ] ], "Body": "FROM Yelp_A.Reviews R\n SELECT R.review_id, R.user_id" } ] }, { "Label": "ABOUT", "DestinationLabel": "Business", "SourceLabel": "Review", "Definitions": [ { "SourceKey": [ [ "review_id" ] ], "DestinationKey": [ [ "business_id" ] ], "Body": "FROM Yelp_A.Reviews R\n SELECT R.review_id, R.business_id" } ] } ], "DependentDataverse": "Yelp_A", "DependentName": "Reviews", "DependentKind": "DATASET" }
+{ "DataverseName": "Yelp", "GraphName": "YelpGraph_1", "Vertices": [ { "Label": "User", "Definitions": [ { "PrimaryKey": [ [ "user_id" ] ], "Body": "Yelp_B.Yelpers" } ] }, { "Label": "Review", "Definitions": [ { "PrimaryKey": [ [ "review_id" ] ], "Body": "FROM Yelp_A.Reviews R\n SELECT VALUE R" } ] }, { "Label": "Business", "Definitions": [ { "PrimaryKey": [ [ "business_id" ] ], "Body": "FROM Yelp_A.RelevantBusinesses() B\n SELECT VALUE B" } ] } ], "Edges": [ { "Label": "FRIENDS_WITH", "DestinationLabel": "User", "SourceLabel": "User", "Definitions": [ { "SourceKey": [ [ "user_id" ] ], "DestinationKey": [ [ "friend" ] ], "Body": "FROM Yelp_B.Users U\n UNNEST U.friends F\n SELECT U.user_id, F AS friend" }, { "SourceKey": [ [ "user_id" ] ], "DestinationKey": [ [ "friend" ] ], "Body": "FROM Yelp_B.Friends F\n SELECT F.*" } ] }, { "Label": "MADE_BY", "DestinationLabel": "User", "SourceLabel": "Review", "Definitions": [ { "SourceKey": [ [ "review_id" ] ], "DestinationKey": [ [ "user_id" ] ], "Body": "FROM Yelp_A.Reviews R\n SELECT R.review_id, R.user_id" } ] }, { "Label": "ABOUT", "DestinationLabel": "Business", "SourceLabel": "Review", "Definitions": [ { "SourceKey": [ [ "review_id" ] ], "DestinationKey": [ [ "business_id" ] ], "Body": "FROM Yelp_A.Reviews R\n SELECT R.review_id, R.business_id" } ] } ], "DependentDataverse": "Yelp_B", "DependentName": "Friends", "DependentKind": "DATASET" }
+{ "DataverseName": "Yelp", "GraphName": "YelpGraph_1", "Vertices": [ { "Label": "User", "Definitions": [ { "PrimaryKey": [ [ "user_id" ] ], "Body": "Yelp_B.Yelpers" } ] }, { "Label": "Review", "Definitions": [ { "PrimaryKey": [ [ "review_id" ] ], "Body": "FROM Yelp_A.Reviews R\n SELECT VALUE R" } ] }, { "Label": "Business", "Definitions": [ { "PrimaryKey": [ [ "business_id" ] ], "Body": "FROM Yelp_A.RelevantBusinesses() B\n SELECT VALUE B" } ] } ], "Edges": [ { "Label": "FRIENDS_WITH", "DestinationLabel": "User", "SourceLabel": "User", "Definitions": [ { "SourceKey": [ [ "user_id" ] ], "DestinationKey": [ [ "friend" ] ], "Body": "FROM Yelp_B.Users U\n UNNEST U.friends F\n SELECT U.user_id, F AS friend" }, { "SourceKey": [ [ "user_id" ] ], "DestinationKey": [ [ "friend" ] ], "Body": "FROM Yelp_B.Friends F\n SELECT F.*" } ] }, { "Label": "MADE_BY", "DestinationLabel": "User", "SourceLabel": "Review", "Definitions": [ { "SourceKey": [ [ "review_id" ] ], "DestinationKey": [ [ "user_id" ] ], "Body": "FROM Yelp_A.Reviews R\n SELECT R.review_id, R.user_id" } ] }, { "Label": "ABOUT", "DestinationLabel": "Business", "SourceLabel": "Review", "Definitions": [ { "SourceKey": [ [ "review_id" ] ], "DestinationKey": [ [ "business_id" ] ], "Body": "FROM Yelp_A.Reviews R\n SELECT R.review_id, R.business_id" } ] } ], "DependentDataverse": "Yelp_B", "DependentName": "Users", "DependentKind": "DATASET" }
+{ "DataverseName": "Yelp", "GraphName": "YelpGraph_1", "Vertices": [ { "Label": "User", "Definitions": [ { "PrimaryKey": [ [ "user_id" ] ], "Body": "Yelp_B.Yelpers" } ] }, { "Label": "Review", "Definitions": [ { "PrimaryKey": [ [ "review_id" ] ], "Body": "FROM Yelp_A.Reviews R\n SELECT VALUE R" } ] }, { "Label": "Business", "Definitions": [ { "PrimaryKey": [ [ "business_id" ] ], "Body": "FROM Yelp_A.RelevantBusinesses() B\n SELECT VALUE B" } ] } ], "Edges": [ { "Label": "FRIENDS_WITH", "DestinationLabel": "User", "SourceLabel": "User", "Definitions": [ { "SourceKey": [ [ "user_id" ] ], "DestinationKey": [ [ "friend" ] ], "Body": "FROM Yelp_B.Users U\n UNNEST U.friends F\n SELECT U.user_id, F AS friend" }, { "SourceKey": [ [ "user_id" ] ], "DestinationKey": [ [ "friend" ] ], "Body": "FROM Yelp_B.Friends F\n SELECT F.*" } ] }, { "Label": "MADE_BY", "DestinationLabel": "User", "SourceLabel": "Review", "Definitions": [ { "SourceKey": [ [ "review_id" ] ], "DestinationKey": [ [ "user_id" ] ], "Body": "FROM Yelp_A.Reviews R\n SELECT R.review_id, R.user_id" } ] }, { "Label": "ABOUT", "DestinationLabel": "Business", "SourceLabel": "Review", "Definitions": [ { "SourceKey": [ [ "review_id" ] ], "DestinationKey": [ [ "business_id" ] ], "Body": "FROM Yelp_A.Reviews R\n SELECT R.review_id, R.business_id" } ] } ], "DependentDataverse": "Yelp_B", "DependentName": "Yelpers", "DependentKind": "SYNONYM" }
+{ "DataverseName": "Yelp", "GraphName": "YelpGraph_2", "Vertices": [ { "Label": "Review", "Definitions": [ { "PrimaryKey": [ [ "review_id" ] ], "Body": "FROM Yelp_A.Reviews R\n SELECT VALUE R" } ] }, { "Label": "Business", "Definitions": [ { "PrimaryKey": [ [ "business_id" ] ], "Body": "FROM Yelp_A.RelevantBusinesses() B\n SELECT VALUE B" } ] } ], "Edges": [ { "Label": "ABOUT", "DestinationLabel": "Business", "SourceLabel": "Review", "Definitions": [ { "SourceKey": [ [ "review_id" ] ], "DestinationKey": [ [ "business_id" ] ], "Body": "FROM Yelp_A.Reviews R\n SELECT VALUE R" } ] } ], "DependentDataverse": "Yelp_A", "DependentName": "RelevantBusinesses", "DependentKind": "FUNCTION" }
+{ "DataverseName": "Yelp", "GraphName": "YelpGraph_2", "Vertices": [ { "Label": "Review", "Definitions": [ { "PrimaryKey": [ [ "review_id" ] ], "Body": "FROM Yelp_A.Reviews R\n SELECT VALUE R" } ] }, { "Label": "Business", "Definitions": [ { "PrimaryKey": [ [ "business_id" ] ], "Body": "FROM Yelp_A.RelevantBusinesses() B\n SELECT VALUE B" } ] } ], "Edges": [ { "Label": "ABOUT", "DestinationLabel": "Business", "SourceLabel": "Review", "Definitions": [ { "SourceKey": [ [ "review_id" ] ], "DestinationKey": [ [ "business_id" ] ], "Body": "FROM Yelp_A.Reviews R\n SELECT VALUE R" } ] } ], "DependentDataverse": "Yelp_A", "DependentName": "Reviews", "DependentKind": "DATASET" }
\ No newline at end of file
diff --git a/asterix-graphix/src/test/resources/metadatats/results/graphix/create-drop-graph/create-drop-graph.4.adm b/asterix-graphix/src/test/resources/metadatats/results/graphix/create-drop-graph/create-drop-graph.4.adm
new file mode 100644
index 0000000..2f07e94
--- /dev/null
+++ b/asterix-graphix/src/test/resources/metadatats/results/graphix/create-drop-graph/create-drop-graph.4.adm
@@ -0,0 +1,2 @@
+{ "DataverseName": "Yelp", "GraphName": "YelpGraph_2", "Vertices": [ { "Label": "Review", "Definitions": [ { "PrimaryKey": [ [ "review_id" ] ], "Body": "FROM Yelp_A.Reviews R\n SELECT VALUE R" } ] }, { "Label": "Business", "Definitions": [ { "PrimaryKey": [ [ "business_id" ] ], "Body": "FROM Yelp_A.RelevantBusinesses() B\n SELECT VALUE B" } ] } ], "Edges": [ { "Label": "ABOUT", "DestinationLabel": "Business", "SourceLabel": "Review", "Definitions": [ { "SourceKey": [ [ "review_id" ] ], "DestinationKey": [ [ "business_id" ] ], "Body": "FROM Yelp_A.Reviews R\n SELECT VALUE R" } ] } ], "DependentDataverse": "Yelp_A", "DependentName": "RelevantBusinesses", "DependentKind": "FUNCTION" }
+{ "DataverseName": "Yelp", "GraphName": "YelpGraph_2", "Vertices": [ { "Label": "Review", "Definitions": [ { "PrimaryKey": [ [ "review_id" ] ], "Body": "FROM Yelp_A.Reviews R\n SELECT VALUE R" } ] }, { "Label": "Business", "Definitions": [ { "PrimaryKey": [ [ "business_id" ] ], "Body": "FROM Yelp_A.RelevantBusinesses() B\n SELECT VALUE B" } ] } ], "Edges": [ { "Label": "ABOUT", "DestinationLabel": "Business", "SourceLabel": "Review", "Definitions": [ { "SourceKey": [ [ "review_id" ] ], "DestinationKey": [ [ "business_id" ] ], "Body": "FROM Yelp_A.Reviews R\n SELECT VALUE R" } ] } ], "DependentDataverse": "Yelp_A", "DependentName": "Reviews", "DependentKind": "DATASET" }
\ No newline at end of file
diff --git a/asterix-graphix/src/test/resources/metadatats/results/graphix/create-drop-graph/create-drop-graph.6.adm b/asterix-graphix/src/test/resources/metadatats/results/graphix/create-drop-graph/create-drop-graph.6.adm
new file mode 100644
index 0000000..f761b45
--- /dev/null
+++ b/asterix-graphix/src/test/resources/metadatats/results/graphix/create-drop-graph/create-drop-graph.6.adm
@@ -0,0 +1,5 @@
+{ "DataverseName": "Yelp", "GraphName": "YelpGraph_2", "Vertices": [ { "Label": "User", "Definitions": [ { "PrimaryKey": [ [ "user_id" ] ], "Body": "Yelp_B.Yelpers" } ] }, { "Label": "Review", "Definitions": [ { "PrimaryKey": [ [ "review_id" ] ], "Body": "FROM Yelp_A.Reviews R\n SELECT VALUE R" } ] }, { "Label": "Business", "Definitions": [ { "PrimaryKey": [ [ "business_id" ] ], "Body": "FROM Yelp_A.RelevantBusinesses() B\n SELECT VALUE B" } ] } ], "Edges": [ { "Label": "FRIENDS_WITH", "DestinationLabel": "User", "SourceLabel": "User", "Definitions": [ { "SourceKey": [ [ "user_id" ] ], "DestinationKey": [ [ "friend" ] ], "Body": "FROM Yelp_B.Users U\n UNNEST U.friends F\n SELECT U.user_id, F AS friend" }, { "SourceKey": [ [ "user_id" ] ], "DestinationKey": [ [ "friend" ] ], "Body": "FROM Yelp_B.Friends F\n SELECT F.*" } ] }, { "Label": "MADE_BY", "DestinationLabel": "User", "SourceLabel": "Review", "Definitions": [ { "SourceKey": [ [ "review_id" ] ], "DestinationKey": [ [ "user_id" ] ], "Body": "FROM Yelp_A.Reviews R\n SELECT VALUE R" } ] }, { "Label": "ABOUT", "DestinationLabel": "Business", "SourceLabel": "Review", "Definitions": [ { "SourceKey": [ [ "review_id" ] ], "DestinationKey": [ [ "business_id" ] ], "Body": "FROM Yelp_A.Reviews R\n SELECT VALUE R" } ] } ], "DependentDataverse": "Yelp_A", "DependentName": "RelevantBusinesses", "DependentKind": "FUNCTION" }
+{ "DataverseName": "Yelp", "GraphName": "YelpGraph_2", "Vertices": [ { "Label": "User", "Definitions": [ { "PrimaryKey": [ [ "user_id" ] ], "Body": "Yelp_B.Yelpers" } ] }, { "Label": "Review", "Definitions": [ { "PrimaryKey": [ [ "review_id" ] ], "Body": "FROM Yelp_A.Reviews R\n SELECT VALUE R" } ] }, { "Label": "Business", "Definitions": [ { "PrimaryKey": [ [ "business_id" ] ], "Body": "FROM Yelp_A.RelevantBusinesses() B\n SELECT VALUE B" } ] } ], "Edges": [ { "Label": "FRIENDS_WITH", "DestinationLabel": "User", "SourceLabel": "User", "Definitions": [ { "SourceKey": [ [ "user_id" ] ], "DestinationKey": [ [ "friend" ] ], "Body": "FROM Yelp_B.Users U\n UNNEST U.friends F\n SELECT U.user_id, F AS friend" }, { "SourceKey": [ [ "user_id" ] ], "DestinationKey": [ [ "friend" ] ], "Body": "FROM Yelp_B.Friends F\n SELECT F.*" } ] }, { "Label": "MADE_BY", "DestinationLabel": "User", "SourceLabel": "Review", "Definitions": [ { "SourceKey": [ [ "review_id" ] ], "DestinationKey": [ [ "user_id" ] ], "Body": "FROM Yelp_A.Reviews R\n SELECT VALUE R" } ] }, { "Label": "ABOUT", "DestinationLabel": "Business", "SourceLabel": "Review", "Definitions": [ { "SourceKey": [ [ "review_id" ] ], "DestinationKey": [ [ "business_id" ] ], "Body": "FROM Yelp_A.Reviews R\n SELECT VALUE R" } ] } ], "DependentDataverse": "Yelp_A", "DependentName": "Reviews", "DependentKind": "DATASET" }
+{ "DataverseName": "Yelp", "GraphName": "YelpGraph_2", "Vertices": [ { "Label": "User", "Definitions": [ { "PrimaryKey": [ [ "user_id" ] ], "Body": "Yelp_B.Yelpers" } ] }, { "Label": "Review", "Definitions": [ { "PrimaryKey": [ [ "review_id" ] ], "Body": "FROM Yelp_A.Reviews R\n SELECT VALUE R" } ] }, { "Label": "Business", "Definitions": [ { "PrimaryKey": [ [ "business_id" ] ], "Body": "FROM Yelp_A.RelevantBusinesses() B\n SELECT VALUE B" } ] } ], "Edges": [ { "Label": "FRIENDS_WITH", "DestinationLabel": "User", "SourceLabel": "User", "Definitions": [ { "SourceKey": [ [ "user_id" ] ], "DestinationKey": [ [ "friend" ] ], "Body": "FROM Yelp_B.Users U\n UNNEST U.friends F\n SELECT U.user_id, F AS friend" }, { "SourceKey": [ [ "user_id" ] ], "DestinationKey": [ [ "friend" ] ], "Body": "FROM Yelp_B.Friends F\n SELECT F.*" } ] }, { "Label": "MADE_BY", "DestinationLabel": "User", "SourceLabel": "Review", "Definitions": [ { "SourceKey": [ [ "review_id" ] ], "DestinationKey": [ [ "user_id" ] ], "Body": "FROM Yelp_A.Reviews R\n SELECT VALUE R" } ] }, { "Label": "ABOUT", "DestinationLabel": "Business", "SourceLabel": "Review", "Definitions": [ { "SourceKey": [ [ "review_id" ] ], "DestinationKey": [ [ "business_id" ] ], "Body": "FROM Yelp_A.Reviews R\n SELECT VALUE R" } ] } ], "DependentDataverse": "Yelp_B", "DependentName": "Friends", "DependentKind": "DATASET" }
+{ "DataverseName": "Yelp", "GraphName": "YelpGraph_2", "Vertices": [ { "Label": "User", "Definitions": [ { "PrimaryKey": [ [ "user_id" ] ], "Body": "Yelp_B.Yelpers" } ] }, { "Label": "Review", "Definitions": [ { "PrimaryKey": [ [ "review_id" ] ], "Body": "FROM Yelp_A.Reviews R\n SELECT VALUE R" } ] }, { "Label": "Business", "Definitions": [ { "PrimaryKey": [ [ "business_id" ] ], "Body": "FROM Yelp_A.RelevantBusinesses() B\n SELECT VALUE B" } ] } ], "Edges": [ { "Label": "FRIENDS_WITH", "DestinationLabel": "User", "SourceLabel": "User", "Definitions": [ { "SourceKey": [ [ "user_id" ] ], "DestinationKey": [ [ "friend" ] ], "Body": "FROM Yelp_B.Users U\n UNNEST U.friends F\n SELECT U.user_id, F AS friend" }, { "SourceKey": [ [ "user_id" ] ], "DestinationKey": [ [ "friend" ] ], "Body": "FROM Yelp_B.Friends F\n SELECT F.*" } ] }, { "Label": "MADE_BY", "DestinationLabel": "User", "SourceLabel": "Review", "Definitions": [ { "SourceKey": [ [ "review_id" ] ], "DestinationKey": [ [ "user_id" ] ], "Body": "FROM Yelp_A.Reviews R\n SELECT VALUE R" } ] }, { "Label": "ABOUT", "DestinationLabel": "Business", "SourceLabel": "Review", "Definitions": [ { "SourceKey": [ [ "review_id" ] ], "DestinationKey": [ [ "business_id" ] ], "Body": "FROM Yelp_A.Reviews R\n SELECT VALUE R" } ] } ], "DependentDataverse": "Yelp_B", "DependentName": "Users", "DependentKind": "DATASET" }
+{ "DataverseName": "Yelp", "GraphName": "YelpGraph_2", "Vertices": [ { "Label": "User", "Definitions": [ { "PrimaryKey": [ [ "user_id" ] ], "Body": "Yelp_B.Yelpers" } ] }, { "Label": "Review", "Definitions": [ { "PrimaryKey": [ [ "review_id" ] ], "Body": "FROM Yelp_A.Reviews R\n SELECT VALUE R" } ] }, { "Label": "Business", "Definitions": [ { "PrimaryKey": [ [ "business_id" ] ], "Body": "FROM Yelp_A.RelevantBusinesses() B\n SELECT VALUE B" } ] } ], "Edges": [ { "Label": "FRIENDS_WITH", "DestinationLabel": "User", "SourceLabel": "User", "Definitions": [ { "SourceKey": [ [ "user_id" ] ], "DestinationKey": [ [ "friend" ] ], "Body": "FROM Yelp_B.Users U\n UNNEST U.friends F\n SELECT U.user_id, F AS friend" }, { "SourceKey": [ [ "user_id" ] ], "DestinationKey": [ [ "friend" ] ], "Body": "FROM Yelp_B.Friends F\n SELECT F.*" } ] }, { "Label": "MADE_BY", "DestinationLabel": "User", "SourceLabel": "Review", "Definitions": [ { "SourceKey": [ [ "review_id" ] ], "DestinationKey": [ [ "user_id" ] ], "Body": "FROM Yelp_A.Reviews R\n SELECT VALUE R" } ] }, { "Label": "ABOUT", "DestinationLabel": "Business", "SourceLabel": "Review", "Definitions": [ { "SourceKey": [ [ "review_id" ] ], "DestinationKey": [ [ "business_id" ] ], "Body": "FROM Yelp_A.Reviews R\n SELECT VALUE R" } ] } ], "DependentDataverse": "Yelp_B", "DependentName": "Yelpers", "DependentKind": "SYNONYM" }
\ No newline at end of file
diff --git a/asterix-graphix/src/test/resources/metadatats/results/graphix/create-drop-graph/create-drop-graph.8.adm b/asterix-graphix/src/test/resources/metadatats/results/graphix/create-drop-graph/create-drop-graph.8.adm
new file mode 100644
index 0000000..fa28578
--- /dev/null
+++ b/asterix-graphix/src/test/resources/metadatats/results/graphix/create-drop-graph/create-drop-graph.8.adm
@@ -0,0 +1 @@
+{ "graphCount": 0, "dependencyCount": 0 }
\ No newline at end of file
diff --git a/asterix-graphix/src/test/resources/metadatats/results/graphix/on-graph-dependency/on-graph-dependency.2.adm b/asterix-graphix/src/test/resources/metadatats/results/graphix/on-graph-dependency/on-graph-dependency.2.adm
new file mode 100644
index 0000000..b5547c5
--- /dev/null
+++ b/asterix-graphix/src/test/resources/metadatats/results/graphix/on-graph-dependency/on-graph-dependency.2.adm
@@ -0,0 +1 @@
+{ "graph": [ { "DataverseName": "Yelp", "GraphName": "YelpGraph", "DependentDataverse": "Yelp", "DependentName": "Reviews", "DependentKind": "DATASET" }, { "DataverseName": "Yelp", "GraphName": "YelpGraph", "DependentDataverse": "Yelp", "DependentName": "Users", "DependentKind": "DATASET" }, { "DataverseName": "Yelp", "GraphName": "YelpGraphGraph", "DependentDataverse": "Yelp", "DependentName": "Reviews", "DependentKind": "DATASET" }, { "DataverseName": "Yelp", "GraphName": "YelpGraphGraph", "DependentDataverse": "Yelp", "DependentName": "Users", "DependentKind": "DATASET" }, { "DataverseName": "Yelp", "GraphName": "YelpGraphGraph", "DependentDataverse": "Yelp", "DependentName": "YelpGraph", "DependentKind": "GRAPH" } ], "function": [ { "DataverseName": "Yelp", "Name": "YelpGraphFunction", "Arity": "0", "DependentDataverse": "Yelp", "DependentName": "YelpGraph", "DependentKind": "GRAPH" } ], "view": [ { "DataverseName": "Yelp", "DatasetName": "YelpGraphView", "DependentDataverse": "Yelp", "DependentName": "YelpGraph", "DependentKind": "GRAPH" } ] }
\ No newline at end of file
diff --git a/asterix-graphix/src/test/resources/metadatats/results/graphix/on-graph-dependency/on-graph-dependency.4.adm b/asterix-graphix/src/test/resources/metadatats/results/graphix/on-graph-dependency/on-graph-dependency.4.adm
new file mode 100644
index 0000000..c227083
--- /dev/null
+++ b/asterix-graphix/src/test/resources/metadatats/results/graphix/on-graph-dependency/on-graph-dependency.4.adm
@@ -0,0 +1 @@
+0
\ No newline at end of file
diff --git a/asterix-graphix/src/test/resources/metadatats/testsuite.xml b/asterix-graphix/src/test/resources/metadatats/testsuite.xml
new file mode 100644
index 0000000..9861530
--- /dev/null
+++ b/asterix-graphix/src/test/resources/metadatats/testsuite.xml
@@ -0,0 +1,35 @@
+<!--
+ ~ 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.
+ -->
+<test-suite xmlns="urn:xml.testframework.asterix.apache.org"
+ ResultOffsetPath="results"
+ QueryOffsetPath="queries"
+ QueryFileExtension=".sqlpp">
+ <test-group name="create-drop-graph">
+ <test-case FilePath="graphix">
+ <compilation-unit name="create-drop-graph">
+ <output-dir compare="Text">create-drop-graph</output-dir>
+ </compilation-unit>
+ </test-case>
+ </test-group>
+ <test-group name="on-graph-dependency">
+ <test-case FilePath="graphix">
+ <compilation-unit name="on-graph-dependency">
+ <output-dir compare="Text">on-graph-dependency</output-dir>
+ </compilation-unit>
+ </test-case>
+ </test-group>
+</test-suite>