From 6fbb1e902a2ad4676627753fed0d521eba1021bb Mon Sep 17 00:00:00 2001 From: jimingquan Date: Thu, 9 Sep 2021 14:54:54 +0800 Subject: [PATCH] change vertex, edge to vertices, edges --- src/graph/planner/ngql/SubgraphPlanner.cpp | 4 +- src/graph/validator/GetSubgraphValidator.cpp | 18 ++-- src/parser/parser.yy | 9 +- .../bugfix/SubgraphBeforePipe.feature | 8 +- .../features/subgraph/subgraph.IntVid.feature | 86 ++++++++--------- tests/tck/features/subgraph/subgraph.feature | 92 +++++++++---------- 6 files changed, 113 insertions(+), 104 deletions(-) diff --git a/src/graph/planner/ngql/SubgraphPlanner.cpp b/src/graph/planner/ngql/SubgraphPlanner.cpp index 06bf8ca6720..cafedb3f29c 100644 --- a/src/graph/planner/ngql/SubgraphPlanner.cpp +++ b/src/graph/planner/ngql/SubgraphPlanner.cpp @@ -79,7 +79,7 @@ StatusOr SubgraphPlanner::nSteps(SubPlan& startVidPlan, const std::stri auto* dc = DataCollect::make(qctx, DataCollect::DCKind::kSubgraph); dc->addDep(loop); dc->setInputVars({gn->outputVar(), oneMoreStepOutput}); - dc->setColNames({"VERTEX", "EDGE"}); + dc->setColNames({"VERTICES", "EDGES"}); auto* project = Project::make(qctx, dc, subgraphCtx_->yieldExpr); @@ -109,7 +109,7 @@ StatusOr SubgraphPlanner::zeroStep(SubPlan& startVidPlan, const std::st auto* func = AggregateExpression::make(pool, "COLLECT", vertexExpr, false); auto* collect = Aggregate::make(qctx, getVertex, {}, {func}); - collect->setColNames({"VERTEX"}); + collect->setColNames({"VERTICES"}); SubPlan subPlan; subPlan.root = collect; diff --git a/src/graph/validator/GetSubgraphValidator.cpp b/src/graph/validator/GetSubgraphValidator.cpp index 18448a648eb..0c06fe8b94e 100644 --- a/src/graph/validator/GetSubgraphValidator.cpp +++ b/src/graph/validator/GetSubgraphValidator.cpp @@ -104,10 +104,10 @@ Status GetSubgraphValidator::validateYield(YieldClause* yield) { if (yield == nullptr) { // version 3.0: return Status::SemanticError("No Yield Clause"); auto* yieldColumns = new YieldColumns(); - auto* vertex = new YieldColumn(VertexExpression::make(pool)); + auto* vertex = new YieldColumn(LabelExpression::make(pool, "VERTICES")); yieldColumns->addColumn(vertex); if (subgraphCtx_->steps.steps() != 0) { - auto* edge = new YieldColumn(EdgeExpression::make(pool)); + auto* edge = new YieldColumn(LabelExpression::make(pool, "EDGES")); yieldColumns->addColumn(edge); } yield = pool->add(new YieldClause(yieldColumns)); @@ -117,19 +117,21 @@ Status GetSubgraphValidator::validateYield(YieldClause* yield) { YieldColumns* newCols = qctx_->objPool()->add(new YieldColumns()); for (const auto& col : yield->columns()) { - if (col->expr()->kind() == Expression::Kind::kVertex) { + std::string lowerStr = col->expr()->toString(); + folly::toLowerAscii(lowerStr); + if (lowerStr == "vertices") { subgraphCtx_->getVertexProp = true; - auto* newCol = new YieldColumn(InputPropertyExpression::make(pool, "VERTEX"), col->name()); + auto* newCol = new YieldColumn(InputPropertyExpression::make(pool, "VERTICES"), col->name()); newCols->addColumn(newCol); - } else if (col->expr()->kind() == Expression::Kind::kEdge) { + } else if (lowerStr == "edges") { if (subgraphCtx_->steps.steps() == 0) { - return Status::SemanticError("Get Subgraph 0 STEPS only support YIELD vertex"); + return Status::SemanticError("Get Subgraph 0 STEPS only support YIELD VERTICES"); } subgraphCtx_->getEdgeProp = true; - auto* newCol = new YieldColumn(InputPropertyExpression::make(pool, "EDGE"), col->name()); + auto* newCol = new YieldColumn(InputPropertyExpression::make(pool, "EDGES"), col->name()); newCols->addColumn(newCol); } else { - return Status::SemanticError("Get Subgraph only support YIELD vertex OR edge"); + return Status::SemanticError("Get Subgraph only support YIELD VERTICES OR EDGES"); } outputs_.emplace_back(col->name(), Value::Type::LIST); } diff --git a/src/parser/parser.yy b/src/parser/parser.yy index bc0f5a94b95..bfbf8d587b9 100644 --- a/src/parser/parser.yy +++ b/src/parser/parser.yy @@ -1359,10 +1359,17 @@ yield_column | KW_EDGE { $$ = new YieldColumn(EdgeExpression::make(qctx->objPool())); } - | KW_EDGE KW_AS name_label{ + | KW_EDGE KW_AS name_label { $$ = new YieldColumn(EdgeExpression::make(qctx->objPool()), *$3); delete $3; } + | KW_EDGES { + $$ = new YieldColumn(LabelExpression::make(qctx->objPool(), "EDGES")); + } + | KW_EDGES KW_AS name_label { + $$ = new YieldColumn(LabelExpression::make(qctx->objPool(), "EDGES"), *$3); + delete $3; + } | expression { $$ = new YieldColumn($1); } diff --git a/tests/tck/features/bugfix/SubgraphBeforePipe.feature b/tests/tck/features/bugfix/SubgraphBeforePipe.feature index ac50f32fa63..1dbe5555b6a 100644 --- a/tests/tck/features/bugfix/SubgraphBeforePipe.feature +++ b/tests/tck/features/bugfix/SubgraphBeforePipe.feature @@ -35,7 +35,7 @@ Feature: Test get subgraph before pipe | [:teammate "Tim Duncan"->"Manu Ginobili"@0] | | [:teammate "Tim Duncan"->"Tony Parker"@0] | Then the result should be, in any order, with relax comparison: - | VERTEX | EDGE | + | VERTICES | EDGES | | [("Tim Duncan")] | <[edge1]> | Scenario: subgraph as variable with limit @@ -65,7 +65,7 @@ Feature: Test get subgraph before pipe | [:teammate "Tim Duncan"->"Manu Ginobili"@0] | | [:teammate "Tim Duncan"->"Tony Parker"@0] | Then the result should be, in any order, with relax comparison: - | VERTEX | EDGE | + | VERTICES | EDGES | | [("Tim Duncan")] | <[edge1]> | # TODO: access to the output of get subgraph. @@ -157,7 +157,7 @@ Feature: Test get subgraph before pipe | | | [:serve "Tiago Splitter"->"76ers"@0] | | | | [:serve "Tiago Splitter"->"Hawks"@0] | Then the result should be, in any order, with relax comparison: - | VERTEX | EDGE | + | VERTICES | EDGES | | [("Tim Duncan")] | <[edge1]> | | <[vertex2]> | <[edge2]> | @@ -173,7 +173,7 @@ Feature: Test get subgraph before pipe | [:serve "Paul George"->"Thunders"@0] | [:serve "Russell Westbrook"->"Thunders"@0] | | [:like "Paul George"->"Russell Westbrook"@0] | [:like "Russell Westbrook"->"James Harden"@0] | Then the result should be, in any order, with relax comparison: - | VERTEX | EDGE | + | VERTICES | EDGES | | [("Paul George")] | <[edge1]> | | [("Russell Westbrook"), ("Pacers"), ("Thunders")] | <[edge2]> | When executing query: diff --git a/tests/tck/features/subgraph/subgraph.IntVid.feature b/tests/tck/features/subgraph/subgraph.IntVid.feature index 8ed15be582a..98e9b5b9ace 100644 --- a/tests/tck/features/subgraph/subgraph.IntVid.feature +++ b/tests/tck/features/subgraph/subgraph.IntVid.feature @@ -22,17 +22,17 @@ Feature: Integer Vid subgraph """ GET SUBGRAPH WITH PROP FROM hash("Tim Duncan") YIELD vertexs """ - Then a SemanticError should be raised at runtime: Get Subgraph only support YIELD vertex OR edge + Then a SemanticError should be raised at runtime: Get Subgraph only support YIELD VERTICES OR EDGES When executing query: """ - GET SUBGRAPH WITH PROP FROM hash("Tim Duncan") YIELD vertex, edgesa + GET SUBGRAPH WITH PROP FROM hash("Tim Duncan") YIELD vertices, edgesa """ - Then a SemanticError should be raised at runtime: Get Subgraph only support YIELD vertex OR edge + Then a SemanticError should be raised at runtime: Get Subgraph only support YIELD VERTICES OR EDGES When executing query: """ - GET SUBGRAPH WITH PROP 0 STEPS FROM hash("Tim Duncan") YIELD edge + GET SUBGRAPH WITH PROP 0 STEPS FROM hash("Tim Duncan") YIELD edges """ - Then a SemanticError should be raised at runtime: Get Subgraph 0 STEPS only support YIELD vertex + Then a SemanticError should be raised at runtime: Get Subgraph 0 STEPS only support YIELD VERTICES When executing query: """ GO FROM hash("Tim Duncan") OVER like YIELD $$.player.name AS id | GET SUBGRAPH WITH PROP FROM $-.id @@ -65,49 +65,49 @@ Feature: Integer Vid subgraph GET SUBGRAPH WITH PROP 0 STEPS FROM hash("Tim Duncan") """ Then the result should be, in any order, with relax comparison: - | VERTEX | + | VERTICES | | [("Tim Duncan")] | When executing query: """ GET SUBGRAPH WITH PROP 0 STEPS FROM hash("Tim Duncan"), hash("Spurs") """ Then the result should be, in any order, with relax comparison: - | VERTEX | + | VERTICES | | [("Tim Duncan"), ("Spurs")] | When executing query: """ GET SUBGRAPH WITH PROP 0 STEPS FROM hash("Tim Duncan"), hash("Tony Parker"), hash("Spurs") """ Then the result should be, in any order, with relax comparison: - | VERTEX | + | VERTICES | | [("Tim Duncan"), ("Spurs"), ("Tony Parker")] | When executing query: """ GO FROM hash('Tim Duncan') over serve YIELD serve._dst AS id | GET SUBGRAPH WITH PROP 0 STEPS FROM $-.id """ Then the result should be, in any order, with relax comparison: - | VERTEX | + | VERTICES | | [("Spurs")] | When executing query: """ GO FROM hash('Tim Duncan') over like YIELD like._dst AS id | GET SUBGRAPH WITH PROP 0 STEPS FROM $-.id """ Then the result should be, in any order, with relax comparison: - | VERTEX | + | VERTICES | | [("Manu Ginobili"), ("Tony Parker")] | When executing query: """ $a = GO FROM hash('Tim Duncan') over serve YIELD serve._dst AS id; GET SUBGRAPH WITH PROP 0 STEPS FROM $a.id """ Then the result should be, in any order, with relax comparison: - | VERTEX | + | VERTICES | | [("Spurs")] | When executing query: """ $a = GO FROM hash('Tim Duncan') over like YIELD like._dst AS id; GET SUBGRAPH WITH PROP 0 STEPS FROM $a.id """ Then the result should be, in any order, with relax comparison: - | VERTEX | + | VERTICES | | [("Manu Ginobili"), ("Tony Parker")] | Scenario: Integer Vid subgraph @@ -143,7 +143,7 @@ Feature: Integer Vid subgraph | | | [:like "Danny Green"->"Marco Belinelli"@0] | | | | [:serve "Danny Green"->"Spurs"@0] | Then the result should be, in any order, with relax comparison: - | VERTEX | EDGE | + | VERTICES | EDGES | | [("Tim Duncan")] | <[edge1]> | | <[vertex2]> | <[edge2]> | @@ -225,7 +225,7 @@ Feature: Integer Vid subgraph | | | [:serve "Tiago Splitter"->"76ers"@0] | | | | | | [:serve "Tiago Splitter"->"Hawks"@0] | | | Then the result should be, in any order, with relax comparison: - | VERTEX | EDGE | + | VERTICES | EDGES | | [("Tim Duncan")] | <[edge1]> | | <[vertex2]> | <[edge2]> | | <[vertex3]> | <[edge3]> | @@ -255,7 +255,7 @@ Feature: Integer Vid subgraph | | | [:like "Marco Belinelli"->"Tony Parker"@0] | | | | | [:like "Tim Duncan"->"Tony Parker"@0] | | Then the result should be, in any order, with relax comparison: - | VERTEX | EDGE | + | VERTICES | EDGES | | [("Tim Duncan")] | <[edge1]> | | <[vertex2]> | <[edge2]> | | <[vertex3]> | [] | @@ -321,7 +321,7 @@ Feature: Integer Vid subgraph | | | [:like "Marco Belinelli"->"Tony Parker"@0] | | | | | | [:like "Tim Duncan"->"Tony Parker"@0] | | | Then the result should be, in any order, with relax comparison: - | VERTEX | EDGE | + | VERTICES | EDGES | | [("Tim Duncan")] | <[edge1]> | | <[vertex2]> | <[edge2]> | | <[vertex3]> | <[edge3]> | @@ -341,7 +341,7 @@ Feature: Integer Vid subgraph | | | | [:teammate "Manu Ginobili"->"Tony Parker"@0] | | | | | | [:teammate "Tim Duncan"->"Tony Parker"@0] | | Then the result should be, in any order, with relax comparison: - | VERTEX | EDGE | + | VERTICES | EDGES | | <[vertex1]> | <[edge1]> | | <[vertex2]> | <[edge2]> | | <[vertex3]> | [] | @@ -375,7 +375,7 @@ Feature: Integer Vid subgraph | | | | | [:serve "Chris Paul"->"Rockets"@0] | | | | | | [:like "Chris Paul"->"LeBron James"@0] | Then the result should be, in any order, with relax comparison: - | VERTEX | EDGE | + | VERTICES | EDGES | | [("Paul George")] | <[edge1]> | | [("Russell Westbrook"), ("Pacers"), ("Thunders")] | <[edge2]> | | [("Dejounte Murray"), ("James Harden")] | <[edge3]> | @@ -397,7 +397,7 @@ Feature: Integer Vid subgraph | [:like "Tony Parker"->"Manu Ginobili"@0] | | [:like "Dejounte Murray"->"Tim Duncan"@0] | | [:like "Tony Parker"->"Tim Duncan"@0] | | [:like "LaMarcus Aldridge"->"Tim Duncan"@0] | Then the result should be, in any order, with relax comparison: - | VERTEX | EDGE | + | VERTICES | EDGES | | [("Tony Parker")] | <[edge1]> | | <[vertex2]> | <[edge2]> | @@ -434,7 +434,7 @@ Feature: Integer Vid subgraph | | | [:serve "Marco Belinelli"->"Spurs"@1] | | | | [:like "Dejounte Murray"->"Marco Belinelli"@0] | Then the result should be, in any order, with relax comparison: - | VERTEX | EDGE | + | VERTICES | EDGES | | [("Tim Duncan")] | <[edge1]> | | <[vertex2]> | <[edge2]> | @@ -472,7 +472,7 @@ Feature: Integer Vid subgraph | | | [:serve "Marco Belinelli"->"Spurs"@1] | | | | [:like "Dejounte Murray"->"Marco Belinelli"@0] | Then the result should be, in any order, with relax comparison: - | VERTEX | EDGE | + | VERTICES | EDGES | | [("Tim Duncan")] | <[edge1]> | | <[vertex2]> | <[edge2]> | @@ -482,7 +482,7 @@ Feature: Integer Vid subgraph GET SUBGRAPH WITH PROP 4 STEPS FROM hash('Yao Ming') IN teammate OUT serve """ Then the result should be, in any order, with relax comparison: - | VERTEX | EDGE | + | VERTICES | EDGES | | [("Yao Ming")] | [[:serve "Yao Ming"->"Rockets"@0]] | | [("Rockets")] | [] | When executing query: @@ -490,8 +490,8 @@ Feature: Integer Vid subgraph GET SUBGRAPH WITH PROP 4 STEPS FROM hash('NOBODY') IN teammate OUT serve """ Then the result should be, in any order, with relax comparison: - | VERTEX | EDGE | - | [("NOBODY")] | [] | + | VERTICES | EDGES | + | [("NOBODY")] | [] | When executing query: """ GET SUBGRAPH WITH PROP 4 steps from hash('Yao Ming') IN teammate OUT serve BOTH like @@ -572,7 +572,7 @@ Feature: Integer Vid subgraph | | | | | | | [:serve "Tiago Splitter"->"Hawks"@0] | | | | | | | | | | [:serve "Tiago Splitter"->"Spurs"@0] | | | Then the result should be, in any order, with relax comparison: - | VERTEX | EDGE | + | VERTICES | EDGES | | [("Yao Ming")] | <[edge1]> | | <[vertex2]> | <[edge2]> | | <[vertex3]> | <[edge3]> | @@ -640,7 +640,7 @@ Feature: Integer Vid subgraph | | | | | [:like "Chris Paul"->"Carmelo Anthony"@0] | | | | | | | | | | | | [:like "Chris Paul"->"Dwyane Wade"@0] | | | | | | | Then the result should be, in any order, with relax comparison: - | VERTEX | EDGE | + | VERTICES | EDGES | | [("Tony Parker")] | <[edge1]> | | <[vertex2]> | <[edge2]> | | <[vertex3]> | <[edge3]> | @@ -677,7 +677,7 @@ Feature: Integer Vid subgraph | | | [:like "Yao Ming"->"Shaquile O'Neal"@0] | | | | | | | | | [:like "Shaquile O'Neal"->"JaVale McGee"@0] | | | | | | Then the result should be, in any order, with relax comparison: - | VERTEX | EDGE | + | VERTICES | EDGES | | [("Tim Duncan")] | <[edge1]> | | <[vertex2]> | <[edge2]> | | <[vertex3]> | <[edge3]> | @@ -690,7 +690,7 @@ Feature: Integer Vid subgraph GET SUBGRAPH WITH PROP 10000000000000 STEPS FROM hash('Yao Ming') IN teammate OUT serve """ Then the result should be, in any order, with relax comparison: - | VERTEX | EDGE | + | VERTICES | EDGES | | [("Yao Ming")] | [[:serve "Yao Ming"->"Rockets"@0]] | | [("Rockets")] | [] | When executing query: @@ -698,7 +698,7 @@ Feature: Integer Vid subgraph GET SUBGRAPH 10000000000000 STEPS FROM hash('Yao Ming') IN teammate OUT serve """ Then the result should be, in any order, with relax comparison: - | VERTEX | EDGE | + | VERTICES | EDGES | | [("Yao Ming")] | [[:serve "Yao Ming"->"Rockets"@0]] | | [("Rockets")] | [] | @@ -708,7 +708,7 @@ Feature: Integer Vid subgraph GET SUBGRAPH 4 STEPS FROM hash('Yao Ming') IN teammate OUT serve """ Then the result should be, in any order, with relax comparison: - | VERTEX | EDGE | + | VERTICES | EDGES | | [("Yao Ming")] | [[:serve "Yao Ming"->"Rockets"@0]] | | [("Rockets")] | [] | When executing query: @@ -716,8 +716,8 @@ Feature: Integer Vid subgraph GET SUBGRAPH 4 STEPS FROM hash('NOBODY') IN teammate OUT serve """ Then the result should be, in any order, with relax comparison: - | VERTEX | EDGE | - | [("NOBODY")] | [] | + | VERTICES | EDGES | + | [("NOBODY")] | [] | When executing query: """ GET SUBGRAPH 4 steps from hash('Yao Ming') IN teammate OUT serve BOTH like @@ -798,7 +798,7 @@ Feature: Integer Vid subgraph | | | | | | | [:serve "Tiago Splitter"->"Hawks"@0] | | | | | | | | | | [:serve "Tiago Splitter"->"Spurs"@0] | | | Then the result should be, in any order, with relax comparison: - | VERTEX | EDGE | + | VERTICES | EDGES | | [("Yao Ming")] | <[edge1]> | | <[vertex2]> | <[edge2]> | | <[vertex3]> | <[edge3]> | @@ -866,7 +866,7 @@ Feature: Integer Vid subgraph | | | | | [:like "Chris Paul"->"Carmelo Anthony"@0] | | | | | | | | | | | | [:like "Chris Paul"->"Dwyane Wade"@0] | | | | | | | Then the result should be, in any order, with relax comparison: - | VERTEX | EDGE | + | VERTICES | EDGES | | [("Tony Parker")] | <[edge1]> | | <[vertex2]> | <[edge2]> | | <[vertex3]> | <[edge3]> | @@ -903,7 +903,7 @@ Feature: Integer Vid subgraph | | | [:like "Yao Ming"->"Shaquile O'Neal"@0] | | | | | | | | | [:like "Shaquile O'Neal"->"JaVale McGee"@0] | | | | | | Then the result should be, in any order, with relax comparison: - | VERTEX | EDGE | + | VERTICES | EDGES | | [("Tim Duncan")] | <[edge1]> | | <[vertex2]> | <[edge2]> | | <[vertex3]> | <[edge3]> | @@ -913,7 +913,7 @@ Feature: Integer Vid subgraph Scenario: subgraph yield vertex edge When executing query: """ - GET SUBGRAPH WITH PROP 2 STEPS FROM hash('Tim Duncan'), hash('James Harden') IN teammate OUT serve YIELD VERTEX + GET SUBGRAPH WITH PROP 2 STEPS FROM hash('Tim Duncan'), hash('James Harden') IN teammate OUT serve YIELD VERTICES """ Then define some list variables: | vertex1 | vertex2 | @@ -925,13 +925,13 @@ Feature: Integer Vid subgraph | | | | | | Then the result should be, in any order, with relax comparison: - | VERTEX | + | VERTICES | | <[vertex1]> | | <[vertex2]> | | [("Hornets")] | When executing query: """ - GET SUBGRAPH WITH PROP 2 STEPS FROM hash('Tim Duncan') IN like, serve YIELD edge + GET SUBGRAPH WITH PROP 2 STEPS FROM hash('Tim Duncan') IN like, serve YIELD EDGES """ Then define some list variables: | edge1 | edge2 | @@ -953,13 +953,13 @@ Feature: Integer Vid subgraph | | [:like "Marco Belinelli"->"Tony Parker"@0] | | | [:like "Tim Duncan"->"Tony Parker"@0] | Then the result should be, in any order, with relax comparison: - | EDGE | + | EDGES | | <[edge1]> | | <[edge2]> | | [] | When executing query: """ - GET SUBGRAPH WITH PROP FROM hash('Tony Parker') BOTH like YIELD edge, vertex + GET SUBGRAPH WITH PROP FROM hash('Tony Parker') BOTH like YIELD edges, vertices """ Then define some list variables: | edge1 | vertex2 | edge2 | @@ -972,12 +972,12 @@ Feature: Integer Vid subgraph | [:like "Tony Parker"->"Manu Ginobili"@0] | | [:like "Dejounte Murray"->"Tim Duncan"@0] | | [:like "Tony Parker"->"Tim Duncan"@0] | | [:like "LaMarcus Aldridge"->"Tim Duncan"@0] | Then the result should be, in any order, with relax comparison: - | EDGE | VERTEX | + | EDGES | vertices | | <[edge1]> | [("Tony Parker")] | | <[edge2]> | <[vertex2]> | When executing query: """ - GET SUBGRAPH 4 steps from hash('Tim Duncan') BOTH like YIELD VERTEX, EDGE + GET SUBGRAPH 4 steps from hash('Tim Duncan') BOTH like YIELD VERTICES, EDGES """ Then define some list variables: | edge1 | vertex2 | edge2 | vertex3 | edge3 | vertex4 | edge4 | vertex5 | @@ -1005,7 +1005,7 @@ Feature: Integer Vid subgraph | | | [:like "Yao Ming"->"Shaquile O'Neal"@0] | | | | | | | | | [:like "Shaquile O'Neal"->"JaVale McGee"@0] | | | | | | Then the result should be, in any order, with relax comparison: - | VERTEX | EDGE | + | VERTICES | EDGES | | [("Tim Duncan")] | <[edge1]> | | <[vertex2]> | <[edge2]> | | <[vertex3]> | <[edge3]> | diff --git a/tests/tck/features/subgraph/subgraph.feature b/tests/tck/features/subgraph/subgraph.feature index 2df4b58bb88..b3b75741952 100644 --- a/tests/tck/features/subgraph/subgraph.feature +++ b/tests/tck/features/subgraph/subgraph.feature @@ -23,17 +23,17 @@ Feature: subgraph """ GET SUBGRAPH WITH PROP FROM "Tim Duncan" YIELD vertexs """ - Then a SemanticError should be raised at runtime: Get Subgraph only support YIELD vertex OR edge + Then a SemanticError should be raised at runtime: Get Subgraph only support YIELD VERTICES OR EDGES When executing query: """ - GET SUBGRAPH WITH PROP FROM "Tim Duncan" YIELD vertex, edgesa + GET SUBGRAPH WITH PROP FROM "Tim Duncan" YIELD vertices, edgesa """ - Then a SemanticError should be raised at runtime: Get Subgraph only support YIELD vertex OR edge + Then a SemanticError should be raised at runtime: Get Subgraph only support YIELD VERTICES OR EDGES When executing query: """ - GET SUBGRAPH WITH PROP 0 STEPS FROM "Tim Duncan" YIELD edge + GET SUBGRAPH WITH PROP 0 STEPS FROM "Tim Duncan" YIELD edges """ - Then a SemanticError should be raised at runtime: Get Subgraph 0 STEPS only support YIELD vertex + Then a SemanticError should be raised at runtime: Get Subgraph 0 STEPS only support YIELD VERTICES When executing query: """ GO FROM "Tim Duncan" OVER like YIELD $$.player.age AS id | GET SUBGRAPH WITH PROP FROM $-.id @@ -66,49 +66,49 @@ Feature: subgraph GET SUBGRAPH WITH PROP 0 STEPS FROM "Tim Duncan" """ Then the result should be, in any order, with relax comparison: - | VERTEX | + | VERTICES | | [("Tim Duncan")] | When executing query: """ GET SUBGRAPH WITH PROP 0 STEPS FROM "Tim Duncan", "Spurs" """ Then the result should be, in any order, with relax comparison: - | VERTEX | + | VERTICES | | [("Tim Duncan"), ("Spurs")] | When executing query: """ GET SUBGRAPH WITH PROP 0 STEPS FROM "Tim Duncan", "Tony Parker", "Spurs" """ Then the result should be, in any order, with relax comparison: - | VERTEX | + | VERTICES | | [("Tim Duncan"), ("Spurs"), ("Tony Parker")] | When executing query: """ GO FROM 'Tim Duncan' over serve YIELD serve._dst AS id | GET SUBGRAPH WITH PROP 0 STEPS FROM $-.id """ Then the result should be, in any order, with relax comparison: - | VERTEX | + | VERTICES | | [("Spurs")] | When executing query: """ GO FROM 'Tim Duncan' over like YIELD like._dst AS id | GET SUBGRAPH WITH PROP 0 STEPS FROM $-.id """ Then the result should be, in any order, with relax comparison: - | VERTEX | + | VERTICES | | [("Manu Ginobili"), ("Tony Parker")] | When executing query: """ $a = GO FROM 'Tim Duncan' over serve YIELD serve._dst AS id; GET SUBGRAPH WITH PROP 0 STEPS FROM $a.id """ Then the result should be, in any order, with relax comparison: - | VERTEX | + | VERTICES | | [("Spurs")] | When executing query: """ $a = GO FROM 'Tim Duncan' over like YIELD like._dst AS id; GET SUBGRAPH WITH PROP 0 STEPS FROM $a.id """ Then the result should be, in any order, with relax comparison: - | VERTEX | + | VERTICES | | [("Manu Ginobili"), ("Tony Parker")] | Scenario: subgraph @@ -144,7 +144,7 @@ Feature: subgraph | | | [:like "Danny Green"->"Marco Belinelli"@0] | | | | [:serve "Danny Green"->"Spurs"@0] | Then the result should be, in any order, with relax comparison: - | VERTEX | EDGE | + | VERTICES | EDGES | | [("Tim Duncan")] | <[edge1]> | | <[vertex2]> | <[edge2]> | @@ -226,7 +226,7 @@ Feature: subgraph | | | [:serve "Tiago Splitter"->"76ers"@0] | | | | | | [:serve "Tiago Splitter"->"Hawks"@0] | | | Then the result should be, in any order, with relax comparison: - | VERTEX | EDGE | + | VERTICES | EDGES | | [("Tim Duncan")] | <[edge1]> | | <[vertex2]> | <[edge2]> | | <[vertex3]> | <[edge3]> | @@ -256,7 +256,7 @@ Feature: subgraph | | | [:like "Marco Belinelli"->"Tony Parker"@0] | | | | | [:like "Tim Duncan"->"Tony Parker"@0] | | Then the result should be, in any order, with relax comparison: - | VERTEX | EDGE | + | VERTICES | EDGES | | [("Tim Duncan")] | <[edge1]> | | <[vertex2]> | <[edge2]> | | <[vertex3]> | [] | @@ -322,7 +322,7 @@ Feature: subgraph | | | [:like "Marco Belinelli"->"Tony Parker"@0] | | | | | | [:like "Tim Duncan"->"Tony Parker"@0] | | | Then the result should be, in any order, with relax comparison: - | VERTEX | EDGE | + | VERTICES | EDGES | | [("Tim Duncan")] | <[edge1]> | | <[vertex2]> | <[edge2]> | | <[vertex3]> | <[edge3]> | @@ -342,7 +342,7 @@ Feature: subgraph | | | | [:teammate "Manu Ginobili"->"Tony Parker"@0] | | | | | | [:teammate "Tim Duncan"->"Tony Parker"@0] | | Then the result should be, in any order, with relax comparison: - | VERTEX | EDGE | + | VERTICES | EDGES | | <[vertex1]> | <[edge1]> | | <[vertex2]> | <[edge2]> | | <[vertex3]> | [] | @@ -376,7 +376,7 @@ Feature: subgraph | | | | | [:serve "Chris Paul"->"Rockets"@0] | | | | | | [:like "Chris Paul"->"LeBron James"@0] | Then the result should be, in any order, with relax comparison: - | VERTEX | EDGE | + | VERTICES | EDGES | | [("Paul George")] | <[edge1]> | | [("Russell Westbrook"), ("Pacers"), ("Thunders")] | <[edge2]> | | [("Dejounte Murray"), ("James Harden")] | <[edge3]> | @@ -398,7 +398,7 @@ Feature: subgraph | [:like "Tony Parker"->"Manu Ginobili"@0] | | [:like "Dejounte Murray"->"Tim Duncan"@0] | | [:like "Tony Parker"->"Tim Duncan"@0] | | [:like "LaMarcus Aldridge"->"Tim Duncan"@0] | Then the result should be, in any order, with relax comparison: - | VERTEX | EDGE | + | VERTICES | EDGES | | [("Tony Parker")] | <[edge1]> | | <[vertex2]> | <[edge2]> | @@ -435,7 +435,7 @@ Feature: subgraph | | | [:serve "Marco Belinelli"->"Spurs"@1] | | | | [:like "Dejounte Murray"->"Marco Belinelli"@0] | Then the result should be, in any order, with relax comparison: - | VERTEX | EDGE | + | VERTICES | EDGES | | [("Tim Duncan")] | <[edge1]> | | <[vertex2]> | <[edge2]> | @@ -473,7 +473,7 @@ Feature: subgraph | | | [:serve "Marco Belinelli"->"Spurs"@1] | | | | [:like "Dejounte Murray"->"Marco Belinelli"@0] | Then the result should be, in any order, with relax comparison: - | VERTEX | EDGE | + | VERTICES | EDGES | | [("Tim Duncan")] | <[edge1]> | | <[vertex2]> | <[edge2]> | @@ -483,7 +483,7 @@ Feature: subgraph GET SUBGRAPH WITH PROP 4 STEPS FROM 'Yao Ming' IN teammate OUT serve """ Then the result should be, in any order, with relax comparison: - | VERTEX | EDGE | + | VERTICES | EDGES | | [("Yao Ming")] | [[:serve "Yao Ming"->"Rockets"@0]] | | [("Rockets")] | [] | When executing query: @@ -491,8 +491,8 @@ Feature: subgraph GET SUBGRAPH WITH PROP 4 STEPS FROM 'NOBODY' IN teammate OUT serve """ Then the result should be, in any order, with relax comparison: - | VERTEX | EDGE | - | [("NOBODY")] | [] | + | VERTICES | EDGES | + | [("NOBODY")] | [] | When executing query: """ GET SUBGRAPH WITH PROP 4 steps from 'Yao Ming' IN teammate OUT serve BOTH like @@ -573,7 +573,7 @@ Feature: subgraph | | | | | | | [:serve "Tiago Splitter"->"Hawks"@0] | | | | | | | | | | [:serve "Tiago Splitter"->"Spurs"@0] | | | Then the result should be, in any order, with relax comparison: - | VERTEX | EDGE | + | VERTICES | EDGES | | [("Yao Ming")] | <[edge1]> | | <[vertex2]> | <[edge2]> | | <[vertex3]> | <[edge3]> | @@ -641,7 +641,7 @@ Feature: subgraph | | | | | [:like "Chris Paul"->"Carmelo Anthony"@0] | | | | | | | | | | | | [:like "Chris Paul"->"Dwyane Wade"@0] | | | | | | | Then the result should be, in any order, with relax comparison: - | VERTEX | EDGE | + | VERTICES | EDGES | | [("Tony Parker")] | <[edge1]> | | <[vertex2]> | <[edge2]> | | <[vertex3]> | <[edge3]> | @@ -678,7 +678,7 @@ Feature: subgraph | | | [:like "Yao Ming"->"Shaquile O'Neal"@0] | | | | | | | | | [:like "Shaquile O'Neal"->"JaVale McGee"@0] | | | | | | Then the result should be, in any order, with relax comparison: - | VERTEX | EDGE | + | VERTICES | EDGES | | [("Tim Duncan")] | <[edge1]> | | <[vertex2]> | <[edge2]> | | <[vertex3]> | <[edge3]> | @@ -691,7 +691,7 @@ Feature: subgraph GET SUBGRAPH WITH PROP 10000000000000 STEPS FROM 'Yao Ming' IN teammate OUT serve """ Then the result should be, in any order, with relax comparison: - | VERTEX | EDGE | + | VERTICES | EDGES | | [("Yao Ming")] | [[:serve "Yao Ming"->"Rockets"@0]] | | [("Rockets")] | [] | When executing query: @@ -699,7 +699,7 @@ Feature: subgraph GET SUBGRAPH 10000000000000 STEPS FROM 'Yao Ming' IN teammate OUT serve """ Then the result should be, in any order, with relax comparison: - | VERTEX | EDGE | + | VERTICES | EDGES | | [("Yao Ming")] | [[:serve "Yao Ming"->"Rockets"@0]] | | [("Rockets")] | [] | @@ -709,7 +709,7 @@ Feature: subgraph GET SUBGRAPH 4 STEPS FROM 'Yao Ming' IN teammate OUT serve """ Then the result should be, in any order, with relax comparison: - | VERTEX | EDGE | + | VERTICES | EDGES | | [("Yao Ming")] | [[:serve "Yao Ming"->"Rockets"@0]] | | [("Rockets")] | [] | When executing query: @@ -717,8 +717,8 @@ Feature: subgraph GET SUBGRAPH 4 STEPS FROM 'NOBODY' IN teammate OUT serve """ Then the result should be, in any order, with relax comparison: - | VERTEX | EDGE | - | [("NOBODY")] | [] | + | VERTICES | EDGES | + | [("NOBODY")] | [] | When executing query: """ GET SUBGRAPH 4 steps from 'Yao Ming' IN teammate OUT serve BOTH like @@ -799,7 +799,7 @@ Feature: subgraph | | | | | | | [:serve "Tiago Splitter"->"Hawks"@0] | | | | | | | | | | [:serve "Tiago Splitter"->"Spurs"@0] | | | Then the result should be, in any order, with relax comparison: - | VERTEX | EDGE | + | VERTICES | EDGES | | [("Yao Ming")] | <[edge1]> | | <[vertex2]> | <[edge2]> | | <[vertex3]> | <[edge3]> | @@ -867,7 +867,7 @@ Feature: subgraph | | | | | [:like "Chris Paul"->"Carmelo Anthony"@0] | | | | | | | | | | | | [:like "Chris Paul"->"Dwyane Wade"@0] | | | | | | | Then the result should be, in any order, with relax comparison: - | VERTEX | EDGE | + | VERTICES | EDGES | | [("Tony Parker")] | <[edge1]> | | <[vertex2]> | <[edge2]> | | <[vertex3]> | <[edge3]> | @@ -904,7 +904,7 @@ Feature: subgraph | | | [:like "Yao Ming"->"Shaquile O'Neal"@0] | | | | | | | | | [:like "Shaquile O'Neal"->"JaVale McGee"@0] | | | | | | Then the result should be, in any order, with relax comparison: - | VERTEX | EDGE | + | VERTICES | EDGES | | [("Tim Duncan")] | <[edge1]> | | <[vertex2]> | <[edge2]> | | <[vertex3]> | <[edge3]> | @@ -914,7 +914,7 @@ Feature: subgraph Scenario: subgraph yield vertex edge When executing query: """ - GET SUBGRAPH WITH PROP 2 STEPS FROM 'Tim Duncan', 'James Harden' IN teammate OUT serve YIELD VERTEX + GET SUBGRAPH WITH PROP 2 STEPS FROM 'Tim Duncan', 'James Harden' IN teammate OUT serve YIELD VERTICES """ Then define some list variables: | vertex1 | vertex2 | @@ -926,13 +926,13 @@ Feature: subgraph | | | | | | Then the result should be, in any order, with relax comparison: - | VERTEX | + | VERTICES | | <[vertex1]> | | <[vertex2]> | | [("Hornets")] | When executing query: """ - GET SUBGRAPH WITH PROP 2 STEPS FROM 'Tim Duncan' IN like, serve YIELD edge + GET SUBGRAPH WITH PROP 2 STEPS FROM 'Tim Duncan' IN like, serve YIELD edges """ Then define some list variables: | edge1 | edge2 | @@ -954,13 +954,13 @@ Feature: subgraph | | [:like "Marco Belinelli"->"Tony Parker"@0] | | | [:like "Tim Duncan"->"Tony Parker"@0] | Then the result should be, in any order, with relax comparison: - | EDGE | + | EDGES | | <[edge1]> | | <[edge2]> | | [] | When executing query: """ - GET SUBGRAPH WITH PROP FROM 'Tony Parker' BOTH like YIELD edge, vertex + GET SUBGRAPH WITH PROP FROM 'Tony Parker' BOTH like YIELD edges, VERTICES """ Then define some list variables: | edge1 | vertex2 | edge2 | @@ -973,12 +973,12 @@ Feature: subgraph | [:like "Tony Parker"->"Manu Ginobili"@0] | | [:like "Dejounte Murray"->"Tim Duncan"@0] | | [:like "Tony Parker"->"Tim Duncan"@0] | | [:like "LaMarcus Aldridge"->"Tim Duncan"@0] | Then the result should be, in any order, with relax comparison: - | EDGE | VERTEX | + | EDGES | VERTICES | | <[edge1]> | [("Tony Parker")] | | <[edge2]> | <[vertex2]> | When executing query: """ - GET SUBGRAPH 4 steps from 'Tim Duncan' BOTH like YIELD VERTEX, EDGE + GET SUBGRAPH 4 steps from 'Tim Duncan' BOTH like YIELD VERTICES, EDGES """ Then define some list variables: | edge1 | vertex2 | edge2 | vertex3 | edge3 | vertex4 | edge4 | vertex5 | @@ -1006,7 +1006,7 @@ Feature: subgraph | | | [:like "Yao Ming"->"Shaquile O'Neal"@0] | | | | | | | | | [:like "Shaquile O'Neal"->"JaVale McGee"@0] | | | | | | Then the result should be, in any order, with relax comparison: - | VERTEX | EDGE | + | VERTICES | EDGES | | [("Tim Duncan")] | <[edge1]> | | <[vertex2]> | <[edge2]> | | <[vertex3]> | <[edge3]> | @@ -1033,6 +1033,6 @@ Feature: subgraph GET SUBGRAPH 1 STEPS FROM "Tom" """ Then the result should be, in any order, with relax comparison: - | VERTEX | EDGE | - | [("Tom")] | [] | - | [] | [] | + | VERTICES | EDGES | + | [("Tom")] | [] | + | [] | [] |