From b8f56fc77265fec58f4fd523f2158ad841831193 Mon Sep 17 00:00:00 2001 From: jimingquan Date: Wed, 15 Sep 2021 13:51:32 +0800 Subject: [PATCH] Format subgraph (#2555) * format subgraph * add test case * format code * fix unit test error * fix test error * change vertex, edge to vertices, edges * compatible with column names * fix yield colname * add more test * fix test colname * address comment --- .gitignore | 3 + .linters/cpp/checkKeyword.py | 1 + src/graph/context/Iterator.cpp | 7 +- src/graph/context/ast/QueryAstContext.h | 5 +- .../executor/query/DataCollectExecutor.cpp | 10 +- src/graph/planner/ngql/SubgraphPlanner.cpp | 15 +- src/graph/validator/GetSubgraphValidator.cpp | 48 +- src/graph/validator/GetSubgraphValidator.h | 2 + .../test/GetSubgraphValidatorTest.cpp | 47 +- src/parser/TraverseSentences.cpp | 4 + src/parser/TraverseSentences.h | 7 +- src/parser/parser.yy | 42 +- src/parser/scanner.lex | 3 +- .../bugfix/SubgraphBeforePipe.feature | 171 +++- .../features/subgraph/subgraph.IntVid.feature | 968 ++++++++++++++++++ tests/tck/features/subgraph/subgraph.feature | 670 ++++++++++++ 16 files changed, 1969 insertions(+), 34 deletions(-) diff --git a/.gitignore b/.gitignore index 4c30e576fa8..c9920bfafd5 100644 --- a/.gitignore +++ b/.gitignore @@ -62,3 +62,6 @@ venv/ #lock *.lock + +#ctags +.tags diff --git a/.linters/cpp/checkKeyword.py b/.linters/cpp/checkKeyword.py index bd9b9304951..1f72874d104 100755 --- a/.linters/cpp/checkKeyword.py +++ b/.linters/cpp/checkKeyword.py @@ -30,6 +30,7 @@ 'KW_DESCRIBE', 'KW_DESC', 'KW_VERTEX', + 'KW_VERTICES', 'KW_EDGE', 'KW_EDGES', 'KW_UPDATE', diff --git a/src/graph/context/Iterator.cpp b/src/graph/context/Iterator.cpp index c491025a7f9..182598f7d7e 100644 --- a/src/graph/context/Iterator.cpp +++ b/src/graph/context/Iterator.cpp @@ -338,7 +338,7 @@ Value GetNeighborsIter::getVertex() const { } auto vidVal = getColumn(nebula::kVid); - if (!SchemaUtil::isValidVid(vidVal)) { + if (UNLIKELY(!SchemaUtil::isValidVid(vidVal))) { return Value::kNullBadType; } Vertex vertex; @@ -348,7 +348,7 @@ Value GetNeighborsIter::getVertex() const { auto& row = *currentRow_; auto& tagPropNameList = tagProp.second.propList; auto tagColId = tagProp.second.colIdx; - if (!row[tagColId].isList()) { + if (UNLIKELY(!row[tagColId].isList())) { // Ignore the bad value. continue; } @@ -358,6 +358,9 @@ Value GetNeighborsIter::getVertex() const { Tag tag; tag.name = tagProp.first; for (size_t i = 0; i < propList.size(); ++i) { + if (tagPropNameList[i] == nebula::kTag) { + continue; + } tag.props.emplace(tagPropNameList[i], propList[i]); } vertex.tags.emplace_back(std::move(tag)); diff --git a/src/graph/context/ast/QueryAstContext.h b/src/graph/context/ast/QueryAstContext.h index 4c0bb4ac6c7..6cc3e4e975e 100644 --- a/src/graph/context/ast/QueryAstContext.h +++ b/src/graph/context/ast/QueryAstContext.h @@ -120,9 +120,12 @@ struct SubgraphContext final : public AstContext { Starts from; StepClause steps; std::string loopSteps; - + YieldColumns* yieldExpr; + std::vector colNames; std::unordered_set edgeTypes; bool withProp{false}; + bool getVertexProp{false}; + bool getEdgeProp{false}; }; } // namespace graph diff --git a/src/graph/executor/query/DataCollectExecutor.cpp b/src/graph/executor/query/DataCollectExecutor.cpp index 47277a2c386..c15049cec35 100644 --- a/src/graph/executor/query/DataCollectExecutor.cpp +++ b/src/graph/executor/query/DataCollectExecutor.cpp @@ -64,8 +64,6 @@ folly::Future DataCollectExecutor::doCollect() { Status DataCollectExecutor::collectSubgraph(const std::vector& vars) { DataSet ds; ds.colNames = std::move(colNames_); - // the subgraph not need duplicate vertices or edges, so dedup here directly - std::unordered_set uniqueVids; std::unordered_set> uniqueEdges; for (auto i = vars.begin(); i != vars.end(); ++i) { const auto& hist = ectx_->getHistory(*i); @@ -84,16 +82,14 @@ Status DataCollectExecutor::collectSubgraph(const std::vector& vars auto* gnIter = static_cast(iter.get()); auto originVertices = gnIter->getVertices(); for (auto& v : originVertices.values) { - if (!v.isVertex()) { + if (UNLIKELY(!v.isVertex())) { continue; } - if (uniqueVids.emplace(v.getVertex().vid).second) { - vertices.emplace_back(std::move(v)); - } + vertices.emplace_back(std::move(v)); } auto originEdges = gnIter->getEdges(); for (auto& edge : originEdges.values) { - if (!edge.isEdge()) { + if (UNLIKELY(!edge.isEdge())) { continue; } const auto& e = edge.getEdge(); diff --git a/src/graph/planner/ngql/SubgraphPlanner.cpp b/src/graph/planner/ngql/SubgraphPlanner.cpp index 3906e627f1e..1621ff1a573 100644 --- a/src/graph/planner/ngql/SubgraphPlanner.cpp +++ b/src/graph/planner/ngql/SubgraphPlanner.cpp @@ -17,7 +17,7 @@ namespace graph { StatusOr>> SubgraphPlanner::buildEdgeProps() { auto* qctx = subgraphCtx_->qctx; - auto withProp = subgraphCtx_->withProp; + bool getEdgeProp = subgraphCtx_->withProp && subgraphCtx_->getEdgeProp; const auto& space = subgraphCtx_->space; auto& edgeTypes = subgraphCtx_->edgeTypes; @@ -31,7 +31,7 @@ StatusOr>> SubgraphPlanner::buildEdgeProps } } std::vector vEdgeTypes(edgeTypes.begin(), edgeTypes.end()); - auto edgeProps = SchemaUtil::getEdgeProps(qctx, space, std::move(vEdgeTypes), withProp); + auto edgeProps = SchemaUtil::getEdgeProps(qctx, space, std::move(vEdgeTypes), getEdgeProp); NG_RETURN_IF_ERROR(edgeProps); return edgeProps; } @@ -55,7 +55,8 @@ StatusOr SubgraphPlanner::nSteps(SubPlan& startVidPlan, const std::stri const auto& steps = subgraphCtx_->steps; auto* startNode = StartNode::make(qctx); - auto vertexProps = SchemaUtil::getAllVertexProp(qctx, space, subgraphCtx_->withProp); + bool getVertexProp = subgraphCtx_->withProp && subgraphCtx_->getVertexProp; + auto vertexProps = SchemaUtil::getAllVertexProp(qctx, space, getVertexProp); NG_RETURN_IF_ERROR(vertexProps); auto edgeProps = buildEdgeProps(); NG_RETURN_IF_ERROR(edgeProps); @@ -78,10 +79,12 @@ 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({kVertices, kEdges}); + dc->setColNames({"VERTICES", "EDGES"}); + + auto* project = Project::make(qctx, dc, subgraphCtx_->yieldExpr); SubPlan subPlan; - subPlan.root = dc; + subPlan.root = project; subPlan.tail = startVidPlan.tail != nullptr ? startVidPlan.tail : loop; return subPlan; } @@ -106,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({kVertices}); + collect->setColNames(std::move(subgraphCtx_->colNames)); SubPlan subPlan; subPlan.root = collect; diff --git a/src/graph/validator/GetSubgraphValidator.cpp b/src/graph/validator/GetSubgraphValidator.cpp index 8dc7eabf490..2f4fc5f68d3 100644 --- a/src/graph/validator/GetSubgraphValidator.cpp +++ b/src/graph/validator/GetSubgraphValidator.cpp @@ -29,13 +29,7 @@ Status GetSubgraphValidator::validateImpl() { NG_RETURN_IF_ERROR(validateInBound(gsSentence->in())); NG_RETURN_IF_ERROR(validateOutBound(gsSentence->out())); NG_RETURN_IF_ERROR(validateBothInOutBound(gsSentence->both())); - // set output col & type - if (subgraphCtx_->steps.steps() == 0) { - outputs_.emplace_back(kVertices, Value::Type::VERTEX); - } else { - outputs_.emplace_back(kVertices, Value::Type::VERTEX); - outputs_.emplace_back(kEdges, Value::Type::EDGE); - } + NG_RETURN_IF_ERROR(validateYield(gsSentence->yield())); return Status::OK(); } @@ -102,7 +96,47 @@ Status GetSubgraphValidator::validateBothInOutBound(BothInOutClause* out) { edgeTypes.emplace(v); } } + return Status::OK(); +} +Status GetSubgraphValidator::validateYield(YieldClause* yield) { + auto pool = qctx_->objPool(); + if (yield == nullptr) { + // version 3.0: return Status::SemanticError("No Yield Clause"); + auto* yieldColumns = new YieldColumns(); + auto* vertex = new YieldColumn(LabelExpression::make(pool, "_vertices")); + yieldColumns->addColumn(vertex); + if (subgraphCtx_->steps.steps() != 0) { + auto* edge = new YieldColumn(LabelExpression::make(pool, "_edges")); + yieldColumns->addColumn(edge); + } + yield = pool->add(new YieldClause(yieldColumns)); + } + auto size = yield->columns().size(); + outputs_.reserve(size); + YieldColumns* newCols = pool->add(new YieldColumns()); + + for (const auto& col : yield->columns()) { + std::string lowerStr = col->expr()->toString(); + folly::toLowerAscii(lowerStr); + if (lowerStr == "vertices" || lowerStr == "_vertices") { + subgraphCtx_->getVertexProp = true; + auto* newCol = new YieldColumn(InputPropertyExpression::make(pool, "VERTICES"), col->name()); + newCols->addColumn(newCol); + } else if (lowerStr == "edges" || lowerStr == "_edges") { + if (subgraphCtx_->steps.steps() == 0) { + return Status::SemanticError("Get Subgraph 0 STEPS only support YIELD vertices"); + } + subgraphCtx_->getEdgeProp = true; + auto* newCol = new YieldColumn(InputPropertyExpression::make(pool, "EDGES"), col->name()); + newCols->addColumn(newCol); + } else { + return Status::SemanticError("Get Subgraph only support YIELD vertices OR edges"); + } + outputs_.emplace_back(col->name(), Value::Type::LIST); + } + subgraphCtx_->yieldExpr = newCols; + subgraphCtx_->colNames = getOutColNames(); return Status::OK(); } diff --git a/src/graph/validator/GetSubgraphValidator.h b/src/graph/validator/GetSubgraphValidator.h index 140c481178d..1bcfce43e03 100644 --- a/src/graph/validator/GetSubgraphValidator.h +++ b/src/graph/validator/GetSubgraphValidator.h @@ -27,6 +27,8 @@ class GetSubgraphValidator final : public TraversalValidator { Status validateBothInOutBound(BothInOutClause* out); + Status validateYield(YieldClause* yield); + AstContext* getAstContext() override { return subgraphCtx_.get(); } private: diff --git a/src/graph/validator/test/GetSubgraphValidatorTest.cpp b/src/graph/validator/test/GetSubgraphValidatorTest.cpp index 194db00b6bb..3b38d2a8318 100644 --- a/src/graph/validator/test/GetSubgraphValidatorTest.cpp +++ b/src/graph/validator/test/GetSubgraphValidatorTest.cpp @@ -22,6 +22,7 @@ TEST_F(GetSubgraphValidatorTest, Base) { { std::string query = "GET SUBGRAPH FROM \"1\""; std::vector expected = { + PK::kProject, PK::kDataCollect, PK::kLoop, PK::kStart, @@ -34,6 +35,7 @@ TEST_F(GetSubgraphValidatorTest, Base) { { std::string query = "GET SUBGRAPH WITH PROP 3 STEPS FROM \"1\""; std::vector expected = { + PK::kProject, PK::kDataCollect, PK::kLoop, PK::kStart, @@ -44,8 +46,9 @@ TEST_F(GetSubgraphValidatorTest, Base) { EXPECT_TRUE(checkResult(query, expected)); } { - std::string query = "GET SUBGRAPH WITH PROP FROM \"1\" BOTH like"; + std::string query = "GET SUBGRAPH WITH PROP FROM \"1\" BOTH like YIELD vertices AS a"; std::vector expected = { + PK::kProject, PK::kDataCollect, PK::kLoop, PK::kStart, @@ -58,6 +61,7 @@ TEST_F(GetSubgraphValidatorTest, Base) { { std::string query = "GET SUBGRAPH WITH PROP FROM \"1\", \"2\" IN like"; std::vector expected = { + PK::kProject, PK::kDataCollect, PK::kLoop, PK::kStart, @@ -75,6 +79,7 @@ TEST_F(GetSubgraphValidatorTest, Input) { "GO FROM \"1\" OVER like YIELD like._src AS src | GET SUBGRAPH WITH " "PROP FROM $-.src"; std::vector expected = { + PK::kProject, PK::kDataCollect, PK::kLoop, PK::kDedup, @@ -93,6 +98,7 @@ TEST_F(GetSubgraphValidatorTest, Input) { "$a = GO FROM \"1\" OVER like YIELD like._src AS src; GET SUBGRAPH " "FROM $a.src"; std::vector expected = { + PK::kProject, PK::kDataCollect, PK::kLoop, PK::kDedup, @@ -156,6 +162,45 @@ TEST_F(GetSubgraphValidatorTest, Input) { } } +TEST_F(GetSubgraphValidatorTest, invalidYield) { + { + std::string query = "GET SUBGRAPH WITH PROP FROM \"Tim Duncan\" YIELD vertice"; + auto result = checkResult(query); + EXPECT_EQ(std::string(result.message()), + "SemanticError: Get Subgraph only support YIELD vertices OR edges"); + } + { + std::string query = "GET SUBGRAPH WITH PROP FROM \"Tim Duncan\" YIELD vertices"; + auto result = checkResult(query); + EXPECT_EQ(std::string(result.message()), + "SyntaxError: please add alias when using vertices. near `vertices'"); + } + { + std::string query = "GET SUBGRAPH WITH PROP FROM \"Tim Duncan\" YIELD vertices as a, edge"; + auto result = checkResult(query); + EXPECT_EQ(std::string(result.message()), + "SyntaxError: please add alias when using edge. near `edge'"); + } + { + std::string query = "GET SUBGRAPH WITH PROP FROM \"Tim Duncan\" YIELD vertices as a, edges"; + auto result = checkResult(query); + EXPECT_EQ(std::string(result.message()), + "SyntaxError: please add alias when using edges. near `edges'"); + } + { + std::string query = "GET SUBGRAPH WITH PROP FROM \"Tim Duncan\" YIELD path"; + auto result = checkResult(query); + EXPECT_EQ(std::string(result.message()), + "SemanticError: Get Subgraph only support YIELD vertices OR edges"); + } + { + std::string query = "GET SUBGRAPH WITH PROP FROM \"Tim Duncan\" YIELD 123"; + auto result = checkResult(query); + EXPECT_EQ(std::string(result.message()), + "SemanticError: Get Subgraph only support YIELD vertices OR edges"); + } +} + TEST_F(GetSubgraphValidatorTest, RefNotExist) { { std::string query = "GET SUBGRAPH WITH PROP FROM $-.id"; diff --git a/src/parser/TraverseSentences.cpp b/src/parser/TraverseSentences.cpp index 628a7bbf7c8..0862d7ae54f 100644 --- a/src/parser/TraverseSentences.cpp +++ b/src/parser/TraverseSentences.cpp @@ -257,6 +257,10 @@ std::string GetSubgraphSentence::toString() const { buf += " "; buf += both_->toString(); } + if (yield_ != nullptr) { + buf += " "; + buf += yield_->toString(); + } return buf; } } // namespace nebula diff --git a/src/parser/TraverseSentences.h b/src/parser/TraverseSentences.h index 2acc7260e12..b5ac8df07d4 100644 --- a/src/parser/TraverseSentences.h +++ b/src/parser/TraverseSentences.h @@ -432,7 +432,8 @@ class GetSubgraphSentence final : public Sentence { FromClause* from, InBoundClause* in, OutBoundClause* out, - BothInOutClause* both) { + BothInOutClause* both, + YieldClause* yield) { kind_ = Kind::kGetSubgraph; withProp_ = withProp; step_.reset(step); @@ -440,6 +441,7 @@ class GetSubgraphSentence final : public Sentence { in_.reset(in); out_.reset(out); both_.reset(both); + yield_.reset(yield); } StepClause* step() const { return step_.get(); } @@ -454,6 +456,8 @@ class GetSubgraphSentence final : public Sentence { BothInOutClause* both() const { return both_.get(); } + YieldClause* yield() const { return yield_.get(); } + std::string toString() const override; private: @@ -463,6 +467,7 @@ class GetSubgraphSentence final : public Sentence { std::unique_ptr in_; std::unique_ptr out_; std::unique_ptr both_; + std::unique_ptr yield_; }; } // namespace nebula #endif // PARSER_TRAVERSESENTENCES_H_ diff --git a/src/parser/parser.yy b/src/parser/parser.yy index e3369a4b29b..54888f2fec5 100644 --- a/src/parser/parser.yy +++ b/src/parser/parser.yy @@ -161,7 +161,7 @@ static constexpr size_t kCommentLengthLimit = 256; %token KW_BOOL KW_INT8 KW_INT16 KW_INT32 KW_INT64 KW_INT KW_FLOAT KW_DOUBLE %token KW_STRING KW_FIXED_STRING KW_TIMESTAMP KW_DATE KW_TIME KW_DATETIME %token KW_GO KW_AS KW_TO KW_USE KW_SET KW_FROM KW_WHERE KW_ALTER -%token KW_MATCH KW_INSERT KW_VALUES KW_YIELD KW_RETURN KW_CREATE KW_VERTEX +%token KW_MATCH KW_INSERT KW_VALUES KW_YIELD KW_RETURN KW_CREATE KW_VERTEX KW_VERTICES %token KW_EDGE KW_EDGES KW_STEPS KW_OVER KW_UPTO KW_REVERSELY KW_SPACE KW_DELETE KW_FIND %token KW_TAG KW_TAGS KW_UNION KW_INTERSECT KW_MINUS %token KW_NO KW_OVERWRITE KW_IN KW_DESCRIBE KW_DESC KW_SHOW KW_HOST KW_HOSTS KW_PART KW_PARTS KW_ADD @@ -444,7 +444,6 @@ unreserved_keyword | KW_DBA { $$ = new std::string("dba"); } | KW_GUEST { $$ = new std::string("guest"); } | KW_GROUP { $$ = new std::string("group"); } - | KW_PATH { $$ = new std::string("path"); } | KW_DATA { $$ = new std::string("data"); } | KW_LEADER { $$ = new std::string("leader"); } | KW_UUID { $$ = new std::string("uuid"); } @@ -491,6 +490,7 @@ unreserved_keyword | KW_BOTH { $$ = new std::string("both"); } | KW_OUT { $$ = new std::string("out"); } | KW_SUBGRAPH { $$ = new std::string("subgraph"); } + | KW_PATH { $$ = new std::string("path"); } | KW_THEN { $$ = new std::string("then"); } | KW_ELSE { $$ = new std::string("else"); } | KW_END { $$ = new std::string("end"); } @@ -1349,7 +1349,39 @@ yield_columns ; yield_column - : expression { + : KW_VERTEX { + $$ = nullptr; + throw nebula::GraphParser::syntax_error(@1, "please add alias when using vertex."); + } + | KW_VERTEX KW_AS name_label { + $$ = new YieldColumn(VertexExpression::make(qctx->objPool()), *$3); + delete $3; + } + | KW_VERTICES { + $$ = nullptr; + throw nebula::GraphParser::syntax_error(@1, "please add alias when using vertices."); + } + | KW_VERTICES KW_AS name_label { + $$ = new YieldColumn(LabelExpression::make(qctx->objPool(), "VERTICES"), *$3); + delete $3; + } + | KW_EDGE { + $$ = nullptr; + throw nebula::GraphParser::syntax_error(@1, "please add alias when using edge."); + } + | KW_EDGE KW_AS name_label { + $$ = new YieldColumn(EdgeExpression::make(qctx->objPool()), *$3); + delete $3; + } + | KW_EDGES { + $$ = nullptr; + throw nebula::GraphParser::syntax_error(@1, "please add alias when using edges."); + } + | KW_EDGES KW_AS name_label { + $$ = new YieldColumn(LabelExpression::make(qctx->objPool(), "EDGES"), *$3); + delete $3; + } + | expression { $$ = new YieldColumn($1); } | expression KW_AS name_label { @@ -2046,8 +2078,8 @@ both_in_out_clause | KW_BOTH over_edges { $$ = new BothInOutClause($2, BoundClause::BOTH); } get_subgraph_sentence - : KW_GET KW_SUBGRAPH opt_with_properites step_clause from_clause in_bound_clause out_bound_clause both_in_out_clause { - $$ = new GetSubgraphSentence($3, $4, $5, $6, $7, $8); + : KW_GET KW_SUBGRAPH opt_with_properites step_clause from_clause in_bound_clause out_bound_clause both_in_out_clause yield_clause { + $$ = new GetSubgraphSentence($3, $4, $5, $6, $7, $8, $9); } use_sentence diff --git a/src/parser/scanner.lex b/src/parser/scanner.lex index db8056e6b2e..5fc535a20cb 100644 --- a/src/parser/scanner.lex +++ b/src/parser/scanner.lex @@ -65,6 +65,7 @@ IP_OCTET ([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]) "DESCRIBE" { return TokenType::KW_DESCRIBE; } "DESC" { return TokenType::KW_DESC; } "VERTEX" { return TokenType::KW_VERTEX; } +"VERTICES" { return TokenType::KW_VERTICES; } "EDGE" { return TokenType::KW_EDGE; } "EDGES" { return TokenType::KW_EDGES; } "UPDATE" { return TokenType::KW_UPDATE; } @@ -188,7 +189,6 @@ IP_OCTET ([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]) "ACCOUNT" { return TokenType::KW_ACCOUNT; } "JOBS" { return TokenType::KW_JOBS; } "JOB" { return TokenType::KW_JOB; } -"PATH" { return TokenType::KW_PATH; } "BIDIRECT" { return TokenType::KW_BIDIRECT; } "STATS" { return TokenType::KW_STATS; } "STATUS" { return TokenType::KW_STATUS; } @@ -205,6 +205,7 @@ IP_OCTET ([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]) "STORAGE" { return TokenType::KW_STORAGE; } "SHORTEST" { return TokenType::KW_SHORTEST; } "NOLOOP" { return TokenType::KW_NOLOOP; } +"PATH" { return TokenType::KW_PATH; } "OUT" { return TokenType::KW_OUT; } "BOTH" { return TokenType::KW_BOTH; } "SUBGRAPH" { return TokenType::KW_SUBGRAPH; } diff --git a/tests/tck/features/bugfix/SubgraphBeforePipe.feature b/tests/tck/features/bugfix/SubgraphBeforePipe.feature index 1e3db473a2f..b418c4a21f1 100644 --- a/tests/tck/features/bugfix/SubgraphBeforePipe.feature +++ b/tests/tck/features/bugfix/SubgraphBeforePipe.feature @@ -69,15 +69,15 @@ Feature: Test get subgraph before pipe | [("Tim Duncan")] | <[edge1]> | # TODO: access to the output of get subgraph. - # Currently _vertices is a reserved keyword. + # Currently VERTEX is a reserved keyword. # # Scenario: two steps subgraph with limit # When executing query: # """ - # (root@nebula) [nba]> $a = GET SUBGRAPH WITH PROP 3 STEPS FROM 'Paul George' OUT serve BOTH like | yield COUNT($a._vertices) + # (root@nebula) [nba]> $a = GET SUBGRAPH WITH PROP 3 STEPS FROM 'Paul George' OUT serve BOTH like | yield COUNT($a.VERTEX) # """ # Then the result should be, in any order, with relax comparison: - # | COUNT($a._vertices) | + # | COUNT($a.VERTEX) | # | 4 | Scenario: two steps subgraph with limit When executing query: @@ -183,3 +183,168 @@ Feature: Test get subgraph before pipe Then the result should be, in any order, with relax comparison: | COUNT(*) | | 4 | + + Scenario: subgraph with limit + When executing query: + """ + GET SUBGRAPH WITH PROP FROM 'Tim Duncan' YIELD VERTICES as nodes, EDGES as relationships | LIMIT 1 + """ + Then define some list variables: + | edge1 | + | [:teammate "Manu Ginobili"->"Tim Duncan"@0] | + | [:teammate "Tony Parker"->"Tim Duncan"@0] | + | [:like "Aron Baynes"->"Tim Duncan"@0] | + | [:like "Boris Diaw"->"Tim Duncan"@0] | + | [:like "Danny Green"->"Tim Duncan"@0] | + | [:like "Dejounte Murray"->"Tim Duncan"@0] | + | [:like "LaMarcus Aldridge"->"Tim Duncan"@0] | + | [:like "Manu Ginobili"->"Tim Duncan"@0] | + | [:like "Marco Belinelli"->"Tim Duncan"@0] | + | [:like "Shaquile O\'Neal"->"Tim Duncan"@0] | + | [:like "Tiago Splitter"->"Tim Duncan"@0] | + | [:like "Tony Parker"->"Tim Duncan"@0] | + | [:like "Tim Duncan"->"Manu Ginobili"@0] | + | [:like "Tim Duncan"->"Tony Parker"@0] | + | [:serve "Tim Duncan"->"Spurs"@0] | + | [:teammate "Tim Duncan"->"Danny Green"@0] | + | [:teammate "Tim Duncan"->"LaMarcus Aldridge"@0] | + | [:teammate "Tim Duncan"->"Manu Ginobili"@0] | + | [:teammate "Tim Duncan"->"Tony Parker"@0] | + Then the result should be, in any order, with relax comparison: + | nodes | relationships | + | [("Tim Duncan")] | <[edge1]> | + + Scenario: subgraph as variable with limit + When executing query: + """ + $a = GET SUBGRAPH WITH PROP FROM 'Tim Duncan' YIELD VERTICES as nodes, edges as relationships | LIMIT 1 + """ + Then define some list variables: + | edge1 | + | [:teammate "Manu Ginobili"->"Tim Duncan"@0] | + | [:teammate "Tony Parker"->"Tim Duncan"@0] | + | [:like "Aron Baynes"->"Tim Duncan"@0] | + | [:like "Boris Diaw"->"Tim Duncan"@0] | + | [:like "Danny Green"->"Tim Duncan"@0] | + | [:like "Dejounte Murray"->"Tim Duncan"@0] | + | [:like "LaMarcus Aldridge"->"Tim Duncan"@0] | + | [:like "Manu Ginobili"->"Tim Duncan"@0] | + | [:like "Marco Belinelli"->"Tim Duncan"@0] | + | [:like "Shaquile O\'Neal"->"Tim Duncan"@0] | + | [:like "Tiago Splitter"->"Tim Duncan"@0] | + | [:like "Tony Parker"->"Tim Duncan"@0] | + | [:like "Tim Duncan"->"Manu Ginobili"@0] | + | [:like "Tim Duncan"->"Tony Parker"@0] | + | [:serve "Tim Duncan"->"Spurs"@0] | + | [:teammate "Tim Duncan"->"Danny Green"@0] | + | [:teammate "Tim Duncan"->"LaMarcus Aldridge"@0] | + | [:teammate "Tim Duncan"->"Manu Ginobili"@0] | + | [:teammate "Tim Duncan"->"Tony Parker"@0] | + Then the result should be, in any order, with relax comparison: + | nodes | relationships | + | [("Tim Duncan")] | <[edge1]> | + + Scenario: two steps subgraph with limit + When executing query: + """ + GET SUBGRAPH WITH PROP 2 STEPS FROM 'Tim Duncan' YIELD VERTICES as nodes, EDGES as relationships | LIMIT 2 + """ + Then define some list variables: + | edge1 | vertex2 | edge2 | + | [:teammate "Manu Ginobili"->"Tim Duncan"@0] | ("Danny Green") | [:like "Dejounte Murray"->"Danny Green"@0] | + | [:teammate "Tony Parker"->"Tim Duncan"@0] | ("Manu Ginobili") | [:like "Marco Belinelli"->"Danny Green"@0] | + | [:like "Aron Baynes"->"Tim Duncan"@0] | ("Aron Baynes") | [:like "Danny Green"->"LeBron James"@0] | + | [:like "Boris Diaw"->"Tim Duncan"@0] | ("Boris Diaw") | [:like "Danny Green"->"Marco Belinelli"@0] | + | [:like "Danny Green"->"Tim Duncan"@0] | ("Shaquile O\'Neal") | [:serve "Danny Green"->"Cavaliers"@0] | + | [:like "Dejounte Murray"->"Tim Duncan"@0] | ("Tony Parker") | [:serve "Danny Green"->"Raptors"@0] | + | [:like "LaMarcus Aldridge"->"Tim Duncan"@0] | ("Spurs") | [:serve "Danny Green"->"Spurs"@0] | + | [:like "Manu Ginobili"->"Tim Duncan"@0] | ("Dejounte Murray") | [:teammate "Tony Parker"->"Manu Ginobili"@0] | + | [:like "Marco Belinelli"->"Tim Duncan"@0] | ("LaMarcus Aldridge") | [:like "Dejounte Murray"->"Manu Ginobili"@0] | + | [:like "Shaquile O\'Neal"->"Tim Duncan"@0] | ("Marco Belinelli") | [:like "Tiago Splitter"->"Manu Ginobili"@0] | + | [:like "Tiago Splitter"->"Tim Duncan"@0] | ("Tiago Splitter") | [:like "Tony Parker"->"Manu Ginobili"@0] | + | [:like "Tony Parker"->"Tim Duncan"@0] | | [:serve "Manu Ginobili"->"Spurs"@0] | + | [:like "Tim Duncan"->"Manu Ginobili"@0] | | [:teammate "Manu Ginobili"->"Tony Parker"@0] | + | [:like "Tim Duncan"->"Tony Parker"@0] | | [:serve "Aron Baynes"->"Celtics"@0] | + | [:serve "Tim Duncan"->"Spurs"@0] | | [:serve "Aron Baynes"->"Pistons"@0] | + | [:teammate "Tim Duncan"->"Danny Green"@0] | | [:serve "Aron Baynes"->"Spurs"@0] | + | [:teammate "Tim Duncan"->"LaMarcus Aldridge"@0] | | [:like "Boris Diaw"->"Tony Parker"@0] | + | [:teammate "Tim Duncan"->"Manu Ginobili"@0] | | [:serve "Boris Diaw"->"Hawks"@0] | + | [:teammate "Tim Duncan"->"Tony Parker"@0] | | [:serve "Boris Diaw"->"Hornets"@0] | + | | | [:serve "Boris Diaw"->"Jazz"@0] | + | | | [:serve "Boris Diaw"->"Spurs"@0] | + | | | [:serve "Boris Diaw"->"Suns"@0] | + | | | [:like "Yao Ming"->"Shaquile O\'Neal"@0] | + | | | [:like "Shaquile O\'Neal"->"JaVale McGee"@0] | + | | | [:serve "Shaquile O\'Neal"->"Cavaliers"@0] | + | | | [:serve "Shaquile O\'Neal"->"Celtics"@0] | + | | | [:serve "Shaquile O\'Neal"->"Heat"@0] | + | | | [:serve "Shaquile O\'Neal"->"Lakers"@0] | + | | | [:serve "Shaquile O\'Neal"->"Magic"@0] | + | | | [:serve "Shaquile O\'Neal"->"Suns"@0] | + | | | [:like "Dejounte Murray"->"Tony Parker"@0] | + | | | [:like "LaMarcus Aldridge"->"Tony Parker"@0] | + | | | [:like "Marco Belinelli"->"Tony Parker"@0] | + | | | [:like "Tony Parker"->"LaMarcus Aldridge"@0] | + | | | [:serve "Tony Parker"->"Hornets"@0] | + | | | [:serve "Tony Parker"->"Spurs"@0] | + | | | [:teammate "Tony Parker"->"Kyle Anderson"@0] | + | | | [:teammate "Tony Parker"->"LaMarcus Aldridge"@0] | + | | | [:serve "Cory Joseph"->"Spurs"@0] | + | | | [:serve "David West"->"Spurs"@0] | + | | | [:serve "Dejounte Murray"->"Spurs"@0] | + | | | [:serve "Jonathon Simmons"->"Spurs"@0] | + | | | [:serve "Kyle Anderson"->"Spurs"@0] | + | | | [:serve "LaMarcus Aldridge"->"Spurs"@0] | + | | | [:serve "Marco Belinelli"->"Spurs"@0] | + | | | [:serve "Paul Gasol"->"Spurs"@0] | + | | | [:serve "Rudy Gay"->"Spurs"@0] | + | | | [:serve "Tiago Splitter"->"Spurs"@0] | + | | | [:serve "Tracy McGrady"->"Spurs"@0] | + | | | [:serve "Marco Belinelli"->"Spurs"@1] | + | | | [:like "Dejounte Murray"->"Chris Paul"@0] | + | | | [:like "Dejounte Murray"->"James Harden"@0] | + | | | [:like "Dejounte Murray"->"Kevin Durant"@0] | + | | | [:like "Dejounte Murray"->"Kyle Anderson"@0] | + | | | [:like "Dejounte Murray"->"LeBron James"@0] | + | | | [:like "Dejounte Murray"->"Marco Belinelli"@0] | + | | | [:like "Dejounte Murray"->"Russell Westbrook"@0] | + | | | [:like "Damian Lillard"->"LaMarcus Aldridge"@0] | + | | | [:like "Rudy Gay"->"LaMarcus Aldridge"@0] | + | | | [:serve "LaMarcus Aldridge"->"Trail Blazers"@0] | + | | | [:serve "Marco Belinelli"->"76ers"@0] | + | | | [:serve "Marco Belinelli"->"Bulls"@0] | + | | | [:serve "Marco Belinelli"->"Hawks"@0] | + | | | [:serve "Marco Belinelli"->"Hornets"@0] | + | | | [:serve "Marco Belinelli"->"Kings"@0] | + | | | [:serve "Marco Belinelli"->"Raptors"@0] | + | | | [:serve "Marco Belinelli"->"Warriors"@0] | + | | | [:serve "Marco Belinelli"->"Hornets"@1] | + | | | [:serve "Tiago Splitter"->"76ers"@0] | + | | | [:serve "Tiago Splitter"->"Hawks"@0] | + Then the result should be, in any order, with relax comparison: + | nodes | relationships | + | [("Tim Duncan")] | <[edge1]> | + | <[vertex2]> | <[edge2]> | + + Scenario: three steps subgraph with property + direction + limit + When executing query: + """ + GET SUBGRAPH WITH PROP 3 STEPS FROM 'Paul George' OUT serve BOTH like YIELD vertices as nodes, edges as relationships | LIMIT 2 + """ + Then define some list variables: + | edge1 | edge2 | + | [:like "Russell Westbrook"->"Paul George"@0] | [:like "Dejounte Murray"->"Russell Westbrook"@0] | + | [:serve "Paul George"->"Pacers"@0] | [:like "James Harden"->"Russell Westbrook"@0] | + | [: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: + | nodes | relationships | + | [("Paul George")] | <[edge1]> | + | [("Russell Westbrook"), ("Pacers"), ("Thunders")] | <[edge2]> | + When executing query: + """ + GET SUBGRAPH WITH PROP 3 STEPS FROM 'Paul George' OUT serve BOTH like YIELD vertices as a, edges as b | YIELD COUNT(*) + """ + Then the result should be, in any order, with relax comparison: + | COUNT(*) | + | 4 | diff --git a/tests/tck/features/subgraph/subgraph.IntVid.feature b/tests/tck/features/subgraph/subgraph.IntVid.feature index dd6c80a271f..c5080f91d9f 100644 --- a/tests/tck/features/subgraph/subgraph.IntVid.feature +++ b/tests/tck/features/subgraph/subgraph.IntVid.feature @@ -18,6 +18,21 @@ Feature: Integer Vid subgraph GET SUBGRAPH WITH PROP FROM $a.id """ Then a SemanticError should be raised at runtime: `$a.id', not exist variable `a' + When executing query: + """ + GET SUBGRAPH WITH PROP FROM hash("Tim Duncan") YIELD vertexs + """ + 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 vertices, edgesa + """ + Then a SyntaxError should be raised at runtime: please add alias when using vertices. near `vertices' + When executing query: + """ + GET SUBGRAPH WITH PROP 0 STEPS FROM hash("Tim Duncan") YIELD edges + """ + Then a SyntaxError should be raised at runtime: please add alias when using edges. near `edges' When executing query: """ GO FROM hash("Tim Duncan") OVER like YIELD $$.player.name AS id | GET SUBGRAPH WITH PROP FROM $-.id @@ -894,3 +909,956 @@ Feature: Integer Vid subgraph | <[vertex3]> | <[edge3]> | | <[vertex4]> | <[edge4]> | | <[vertex5]> | [] | + + Scenario: yield Integer Vid zero step + When executing query: + """ + GET SUBGRAPH WITH PROP 0 STEPS FROM hash("Tim Duncan") YIELD vertices as nodes + """ + Then the result should be, in any order, with relax comparison: + | nodes | + | [("Tim Duncan")] | + When executing query: + """ + GET SUBGRAPH WITH PROP 0 STEPS FROM hash("Tim Duncan"), hash("Spurs") YIELD vertices as nodes + """ + Then the result should be, in any order, with relax comparison: + | nodes | + | [("Tim Duncan"), ("Spurs")] | + When executing query: + """ + GET SUBGRAPH WITH PROP 0 STEPS FROM hash("Tim Duncan"), hash("Tony Parker"), hash("Spurs") YIELD VERTICES as nodes + """ + Then the result should be, in any order, with relax comparison: + | nodes | + | [("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 YIELD Vertices as nodes + """ + Then the result should be, in any order, with relax comparison: + | nodes | + | [("Spurs")] | + When executing query: + """ + GO FROM hash('Tim Duncan') over like YIELD like._dst AS id | GET SUBGRAPH WITH PROP 0 STEPS FROM $-.id YIELD vertices as nodes + """ + Then the result should be, in any order, with relax comparison: + | nodes | + | [("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 YIELD VERTICES as nodes + """ + Then the result should be, in any order, with relax comparison: + | nodes | + | [("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 YIELD vertices as nodes + """ + Then the result should be, in any order, with relax comparison: + | nodes | + | [("Manu Ginobili"), ("Tony Parker")] | + + Scenario: yield Integer Vid subgraph + When executing query: + """ + GET SUBGRAPH WITH PROP FROM hash('Tim Duncan') YIELD vertices as nodes, edges as relationships + """ + Then define some list variables: + | edge1 | vertex2 | edge2 | + | [:teammate "Manu Ginobili"->"Tim Duncan"@0] | ("Danny Green") | [:teammate "Tony Parker"->"Manu Ginobili"@0] | + | [:teammate "Tony Parker"->"Tim Duncan"@0] | ("Manu Ginobili") | [:like "Dejounte Murray"->"Manu Ginobili"@0] | + | [:like "Aron Baynes"->"Tim Duncan"@0] | ("Aron Baynes") | [:like "Tiago Splitter"->"Manu Ginobili"@0] | + | [:like "Boris Diaw"->"Tim Duncan"@0] | ("Boris Diaw") | [:like "Tony Parker"->"Manu Ginobili"@0] | + | [:like "Danny Green"->"Tim Duncan"@0] | ("Shaquile O\'Neal") | [:serve "Manu Ginobili"->"Spurs"@0] | + | [:like "Dejounte Murray"->"Tim Duncan"@0] | ("Tony Parker") | [:teammate "Manu Ginobili"->"Tony Parker"@0] | + | [:like "LaMarcus Aldridge"->"Tim Duncan"@0] | ("Spurs") | [:serve "Aron Baynes"->"Spurs"@0] | + | [:like "Manu Ginobili"->"Tim Duncan"@0] | ("Dejounte Murray") | [:like "Boris Diaw"->"Tony Parker"@0] | + | [:like "Marco Belinelli"->"Tim Duncan"@0] | ("LaMarcus Aldridge") | [:serve "Boris Diaw"->"Spurs"@0] | + | [:like "Shaquile O\'Neal"->"Tim Duncan"@0] | ("Marco Belinelli") | [:like "Dejounte Murray"->"Tony Parker"@0] | + | [:like "Tiago Splitter"->"Tim Duncan"@0] | ("Tiago Splitter") | [:like "LaMarcus Aldridge"->"Tony Parker"@0] | + | [:like "Tony Parker"->"Tim Duncan"@0] | | [:like "Marco Belinelli"->"Tony Parker"@0] | + | [:like "Tim Duncan"->"Manu Ginobili"@0] | | [:like "Tony Parker"->"LaMarcus Aldridge"@0] | + | [:like "Tim Duncan"->"Tony Parker"@0] | | [:serve "Tony Parker"->"Spurs"@0] | + | [:serve "Tim Duncan"->"Spurs"@0] | | [:teammate "Tony Parker"->"LaMarcus Aldridge"@0] | + | [:teammate "Tim Duncan"->"Danny Green"@0] | | [:serve "Dejounte Murray"->"Spurs"@0] | + | [:teammate "Tim Duncan"->"LaMarcus Aldridge"@0] | | [:serve "LaMarcus Aldridge"->"Spurs"@0] | + | [:teammate "Tim Duncan"->"Manu Ginobili"@0] | | [:serve "Marco Belinelli"->"Spurs"@0] | + | [:teammate "Tim Duncan"->"Tony Parker"@0] | | [:serve "Tiago Splitter"->"Spurs"@0] | + | | | [:serve "Marco Belinelli"->"Spurs"@1] | + | | | [:like "Dejounte Murray"->"Marco Belinelli"@0] | + | | | [:like "Dejounte Murray"->"Danny Green"@0] | + | | | [:like "Marco Belinelli"->"Danny Green"@0] | + | | | [:like "Danny Green"->"Marco Belinelli"@0] | + | | | [:serve "Danny Green"->"Spurs"@0] | + Then the result should be, in any order, with relax comparison: + | nodes | relationships | + | [("Tim Duncan")] | <[edge1]> | + | <[vertex2]> | <[edge2]> | + + Scenario: yield Integer Vid two steps + When executing query: + """ + GET SUBGRAPH WITH PROP 2 STEPS FROM hash('Tim Duncan') YIELD vertices as nodes, edges as relationships + """ + Then define some list variables: + | edge1 | vertex2 | edge2 | vertex3 | edge3 | + | [:teammate "Manu Ginobili"->"Tim Duncan"@0] | ("Danny Green") | [:like "Dejounte Murray"->"Danny Green"@0] | ("Cavaliers") | [:serve "LeBron James"->"Cavaliers"@0] | + | [:teammate "Tony Parker"->"Tim Duncan"@0] | ("Manu Ginobili") | [:like "Marco Belinelli"->"Danny Green"@0] | ("Pistons") | [:serve "LeBron James"->"Cavaliers"@1] | + | [:like "Aron Baynes"->"Tim Duncan"@0] | ("Aron Baynes") | [:like "Danny Green"->"LeBron James"@0] | ("Damian Lillard") | [:serve "Damian Lillard"->"Trail Blazers"@0] | + | [:like "Boris Diaw"->"Tim Duncan"@0] | ("Boris Diaw") | [:like "Danny Green"->"Marco Belinelli"@0] | ("Kings") | [:serve "Rudy Gay"->"Kings"@0] | + | [:like "Danny Green"->"Tim Duncan"@0] | ("Shaquile O\'Neal") | [:serve "Danny Green"->"Cavaliers"@0] | ("Raptors") | [:serve "Cory Joseph"->"Raptors"@0] | + | [:like "Dejounte Murray"->"Tim Duncan"@0] | ("Tony Parker") | [:serve "Danny Green"->"Raptors"@0] | ("Jazz") | [:serve "Rudy Gay"->"Raptors"@0] | + | [:like "LaMarcus Aldridge"->"Tim Duncan"@0] | ("Spurs") | [:serve "Danny Green"->"Spurs"@0] | ("LeBron James") | [:serve "Tracy McGrady"->"Raptors"@0] | + | [:like "Manu Ginobili"->"Tim Duncan"@0] | ("Dejounte Murray") | [:teammate "Tony Parker"->"Manu Ginobili"@0] | ("Paul Gasol") | [:like "Chris Paul"->"LeBron James"@0] | + | [:like "Marco Belinelli"->"Tim Duncan"@0] | ("LaMarcus Aldridge") | [:like "Dejounte Murray"->"Manu Ginobili"@0] | ("Kyle Anderson") | [:serve "LeBron James"->"Heat"@0] | + | [:like "Shaquile O\'Neal"->"Tim Duncan"@0] | ("Marco Belinelli") | [:like "Tiago Splitter"->"Manu Ginobili"@0] | ("Rudy Gay") | [:serve "LeBron James"->"Lakers"@0] | + | [:like "Tiago Splitter"->"Tim Duncan"@0] | ("Tiago Splitter") | [:like "Tony Parker"->"Manu Ginobili"@0] | ("Kevin Durant") | [:serve "Paul Gasol"->"Bulls"@0] | + | [:like "Tony Parker"->"Tim Duncan"@0] | | [:serve "Manu Ginobili"->"Spurs"@0] | ("Yao Ming") | [:serve "Paul Gasol"->"Lakers"@0] | + | [:like "Tim Duncan"->"Manu Ginobili"@0] | | [:teammate "Manu Ginobili"->"Tony Parker"@0] | ("James Harden") | [:like "Tracy McGrady"->"Rudy Gay"@0] | + | [:like "Tim Duncan"->"Tony Parker"@0] | | [:serve "Aron Baynes"->"Celtics"@0] | ("Hornets") | [:serve "Kevin Durant"->"Warriors"@0] | + | [:serve "Tim Duncan"->"Spurs"@0] | | [:serve "Aron Baynes"->"Pistons"@0] | ("David West") | [:like "Yao Ming"->"Tracy McGrady"@0] | + | [:teammate "Tim Duncan"->"Danny Green"@0] | | [:serve "Aron Baynes"->"Spurs"@0] | ("Chris Paul") | [:like "Russell Westbrook"->"James Harden"@0] | + | [:teammate "Tim Duncan"->"LaMarcus Aldridge"@0] | | [:like "Boris Diaw"->"Tony Parker"@0] | ("Celtics") | [:like "James Harden"->"Russell Westbrook"@0] | + | [:teammate "Tim Duncan"->"Manu Ginobili"@0] | | [:serve "Boris Diaw"->"Hawks"@0] | ("Jonathon Simmons") | [:serve "Chris Paul"->"Hornets"@0] | + | [:teammate "Tim Duncan"->"Tony Parker"@0] | | [:serve "Boris Diaw"->"Hornets"@0] | ("Hawks") | [:serve "David West"->"Hornets"@0] | + | | | [:serve "Boris Diaw"->"Jazz"@0] | ("Heat") | [:serve "David West"->"Warriors"@0] | + | | | [:serve "Boris Diaw"->"Spurs"@0] | ("Lakers") | [:serve "Jonathon Simmons"->"76ers"@0] | + | | | [:serve "Boris Diaw"->"Suns"@0] | ("Suns") | [:serve "Jonathon Simmons"->"Magic"@0] | + | | | [:like "Yao Ming"->"Shaquile O\'Neal"@0] | ("Magic") | [:serve "JaVale McGee"->"Lakers"@0] | + | | | [:like "Shaquile O\'Neal"->"JaVale McGee"@0] | ("Trail Blazers") | [:serve "Tracy McGrady"->"Magic"@0] | + | | | [:serve "Shaquile O\'Neal"->"Cavaliers"@0] | ("76ers") | [:serve "JaVale McGee"->"Warriors"@0] | + | | | [:serve "Shaquile O\'Neal"->"Celtics"@0] | ("JaVale McGee") | | + | | | [:serve "Shaquile O\'Neal"->"Heat"@0] | ("Cory Joseph") | | + | | | [:serve "Shaquile O\'Neal"->"Lakers"@0] | ("Tracy McGrady") | | + | | | [:serve "Shaquile O\'Neal"->"Magic"@0] | ("Russell Westbrook") | | + | | | [:serve "Shaquile O\'Neal"->"Suns"@0] | ("Bulls") | | + | | | [:like "Dejounte Murray"->"Tony Parker"@0] | ("Warriors") | | + | | | [:like "LaMarcus Aldridge"->"Tony Parker"@0] | | | + | | | [:like "Marco Belinelli"->"Tony Parker"@0] | | | + | | | [:like "Tony Parker"->"LaMarcus Aldridge"@0] | | | + | | | [:serve "Tony Parker"->"Hornets"@0] | | | + | | | [:serve "Tony Parker"->"Spurs"@0] | | | + | | | [:teammate "Tony Parker"->"Kyle Anderson"@0] | | | + | | | [:teammate "Tony Parker"->"LaMarcus Aldridge"@0] | | | + | | | [:serve "Cory Joseph"->"Spurs"@0] | | | + | | | [:serve "David West"->"Spurs"@0] | | | + | | | [:serve "Dejounte Murray"->"Spurs"@0] | | | + | | | [:serve "Jonathon Simmons"->"Spurs"@0] | | | + | | | [:serve "Kyle Anderson"->"Spurs"@0] | | | + | | | [:serve "LaMarcus Aldridge"->"Spurs"@0] | | | + | | | [:serve "Marco Belinelli"->"Spurs"@0] | | | + | | | [:serve "Paul Gasol"->"Spurs"@0] | | | + | | | [:serve "Rudy Gay"->"Spurs"@0] | | | + | | | [:serve "Tiago Splitter"->"Spurs"@0] | | | + | | | [:serve "Tracy McGrady"->"Spurs"@0] | | | + | | | [:serve "Marco Belinelli"->"Spurs"@1] | | | + | | | [:like "Dejounte Murray"->"Chris Paul"@0] | | | + | | | [:like "Dejounte Murray"->"James Harden"@0] | | | + | | | [:like "Dejounte Murray"->"Kevin Durant"@0] | | | + | | | [:like "Dejounte Murray"->"Kyle Anderson"@0] | | | + | | | [:like "Dejounte Murray"->"LeBron James"@0] | | | + | | | [:like "Dejounte Murray"->"Marco Belinelli"@0] | | | + | | | [:like "Dejounte Murray"->"Russell Westbrook"@0] | | | + | | | [:like "Damian Lillard"->"LaMarcus Aldridge"@0] | | | + | | | [:like "Rudy Gay"->"LaMarcus Aldridge"@0] | | | + | | | [:serve "LaMarcus Aldridge"->"Trail Blazers"@0] | | | + | | | [:serve "Marco Belinelli"->"76ers"@0] | | | + | | | [:serve "Marco Belinelli"->"Bulls"@0] | | | + | | | [:serve "Marco Belinelli"->"Hawks"@0] | | | + | | | [:serve "Marco Belinelli"->"Hornets"@0] | | | + | | | [:serve "Marco Belinelli"->"Kings"@0] | | | + | | | [:serve "Marco Belinelli"->"Raptors"@0] | | | + | | | [:serve "Marco Belinelli"->"Warriors"@0] | | | + | | | [:serve "Marco Belinelli"->"Hornets"@1] | | | + | | | [:serve "Tiago Splitter"->"76ers"@0] | | | + | | | [:serve "Tiago Splitter"->"Hawks"@0] | | | + Then the result should be, in any order, with relax comparison: + | nodes | relationships | + | [("Tim Duncan")] | <[edge1]> | + | <[vertex2]> | <[edge2]> | + | <[vertex3]> | <[edge3]> | + + Scenario: yield Integer Vid in edge + When executing query: + """ + GET SUBGRAPH WITH PROP 2 STEPS FROM hash('Tim Duncan') IN like, serve YIELD vertices as a, edges as b + """ + Then define some list variables: + | edge1 | vertex2 | edge2 | vertex3 | + | [:like "Aron Baynes"->"Tim Duncan"@0] | ("LaMarcus Aldridge") | [:like "Damian Lillard"->"LaMarcus Aldridge"@0] | ("Damian Lillard") | + | [:like "Boris Diaw"->"Tim Duncan"@0] | ("Danny Green") | [:like "Rudy Gay"->"LaMarcus Aldridge"@0] | ("Yao Ming") | + | [:like "Danny Green"->"Tim Duncan"@0] | ("Marco Belinelli") | [:like "Tony Parker"->"LaMarcus Aldridge"@0] | ("Rudy Gay") | + | [:like "Dejounte Murray"->"Tim Duncan"@0] | ("Manu Ginobili") | [:like "Dejounte Murray"->"Danny Green"@0] | | + | [:like "LaMarcus Aldridge"->"Tim Duncan"@0] | ("Shaquile O'Neal") | [:like "Marco Belinelli"->"Danny Green"@0] | | + | [:like "Manu Ginobili"->"Tim Duncan"@0] | ("Tony Parker") | [:like "Danny Green"->"Marco Belinelli"@0] | | + | [:like "Marco Belinelli"->"Tim Duncan"@0] | ("Boris Diaw") | [:like "Dejounte Murray"->"Marco Belinelli"@0] | | + | [:like "Shaquile O'Neal"->"Tim Duncan"@0] | ("Dejounte Murray") | [:like "Dejounte Murray"->"Manu Ginobili"@0] | | + | [:like "Tiago Splitter"->"Tim Duncan"@0] | ("Aron Baynes") | [:like "Tiago Splitter"->"Manu Ginobili"@0] | | + | [:like "Tony Parker"->"Tim Duncan"@0] | ("Tiago Splitter") | [:like "Tim Duncan"->"Manu Ginobili"@0] | | + | | | [:like "Tony Parker"->"Manu Ginobili"@0] | | + | | | [:like "Yao Ming"->"Shaquile O'Neal"@0] | | + | | | [:like "Boris Diaw"->"Tony Parker"@0] | | + | | | [:like "Dejounte Murray"->"Tony Parker"@0] | | + | | | [:like "LaMarcus Aldridge"->"Tony Parker"@0] | | + | | | [:like "Marco Belinelli"->"Tony Parker"@0] | | + | | | [:like "Tim Duncan"->"Tony Parker"@0] | | + Then the result should be, in any order, with relax comparison: + | a | b | + | [("Tim Duncan")] | <[edge1]> | + | <[vertex2]> | <[edge2]> | + | <[vertex3]> | [] | + + Scenario: yield Integer Vid in and out edge + When executing query: + """ + GET SUBGRAPH WITH PROP 2 STEPS FROM hash('Tim Duncan') IN like OUT serve YIELD vertices as a, edges as b + """ + Then define some list variables: + | edge1 | vertex2 | edge2 | vertex3 | edge3 | + | [:serve "Tim Duncan"->"Spurs"@0] | ("LaMarcus Aldridge") | [:serve "LaMarcus Aldridge"->"Spurs"@0] | ("Damian Lillard") | [:serve "Damian Lillard"->"Trail Blazers"@0] | + | [:like "Aron Baynes"->"Tim Duncan"@0] | ("Danny Green") | [:serve "LaMarcus Aldridge"->"Trail Blazers"@0] | ("Rudy Gay") | [:serve "Rudy Gay"->"Spurs"@0] | + | [:like "Boris Diaw"->"Tim Duncan"@0] | ("Marco Belinelli") | [:like "Damian Lillard"->"LaMarcus Aldridge"@0] | ("Hornets") | [:serve "Rudy Gay"->"Raptors"@0] | + | [:like "Danny Green"->"Tim Duncan"@0] | ("Boris Diaw") | [:like "Rudy Gay"->"LaMarcus Aldridge"@0] | ("Heat") | [:serve "Rudy Gay"->"Kings"@0] | + | [:like "Dejounte Murray"->"Tim Duncan"@0] | ("Dejounte Murray") | [:like "Tony Parker"->"LaMarcus Aldridge"@0] | ("76ers") | | + | [:like "LaMarcus Aldridge"->"Tim Duncan"@0] | ("Aron Baynes") | [:serve "Danny Green"->"Cavaliers"@0] | ("Bulls") | | + | [:like "Manu Ginobili"->"Tim Duncan"@0] | ("Manu Ginobili") | [:serve "Danny Green"->"Raptors"@0] | ("Trail Blazers") | | + | [:like "Marco Belinelli"->"Tim Duncan"@0] | ("Tiago Splitter") | [:serve "Danny Green"->"Spurs"@0] | ("Celtics") | | + | [:like "Shaquile O'Neal"->"Tim Duncan"@0] | ("Shaquile O'Neal") | [:like "Dejounte Murray"->"Danny Green"@0] | ("Kings") | | + | [:like "Tiago Splitter"->"Tim Duncan"@0] | ("Tony Parker") | [:like "Marco Belinelli"->"Danny Green"@0] | ("Hawks") | | + | [:like "Tony Parker"->"Tim Duncan"@0] | ("Spurs") | [:serve "Marco Belinelli"->"76ers"@0] | ("Warriors") | | + | | | [:serve "Marco Belinelli"->"Bulls"@0] | ("Cavaliers") | | + | | | [:serve "Marco Belinelli"->"Hawks"@0] | ("Raptors") | | + | | | [:serve "Marco Belinelli"->"Hornets"@0] | ("Jazz") | | + | | | [:serve "Marco Belinelli"->"Kings"@0] | ("Pistons") | | + | | | [:serve "Marco Belinelli"->"Raptors"@0] | ("Lakers") | | + | | | [:serve "Marco Belinelli"->"Spurs"@0] | ("Suns") | | + | | | [:serve "Marco Belinelli"->"Warriors"@0] | ("Magic") | | + | | | [:serve "Marco Belinelli"->"Hornets"@1] | ("Yao Ming") | | + | | | [:serve "Marco Belinelli"->"Spurs"@1] | | | + | | | [:like "Danny Green"->"Marco Belinelli"@0] | | | + | | | [:like "Dejounte Murray"->"Marco Belinelli"@0] | | | + | | | [:serve "Boris Diaw"->"Hawks"@0] | | | + | | | [:serve "Boris Diaw"->"Hornets"@0] | | | + | | | [:serve "Boris Diaw"->"Jazz"@0] | | | + | | | [:serve "Boris Diaw"->"Spurs"@0] | | | + | | | [:serve "Boris Diaw"->"Suns"@0] | | | + | | | [:serve "Dejounte Murray"->"Spurs"@0] | | | + | | | [:serve "Aron Baynes"->"Celtics"@0] | | | + | | | [:serve "Aron Baynes"->"Pistons"@0] | | | + | | | [:serve "Aron Baynes"->"Spurs"@0] | | | + | | | [:serve "Manu Ginobili"->"Spurs"@0] | | | + | | | [:like "Dejounte Murray"->"Manu Ginobili"@0] | | | + | | | [:like "Tiago Splitter"->"Manu Ginobili"@0] | | | + | | | [:like "Tim Duncan"->"Manu Ginobili"@0] | | | + | | | [:like "Tony Parker"->"Manu Ginobili"@0] | | | + | | | [:serve "Tiago Splitter"->"76ers"@0] | | | + | | | [:serve "Tiago Splitter"->"Hawks"@0] | | | + | | | [:serve "Tiago Splitter"->"Spurs"@0] | | | + | | | [:serve "Shaquile O'Neal"->"Cavaliers"@0] | | | + | | | [:serve "Shaquile O'Neal"->"Celtics"@0] | | | + | | | [:serve "Shaquile O'Neal"->"Heat"@0] | | | + | | | [:serve "Shaquile O'Neal"->"Lakers"@0] | | | + | | | [:serve "Shaquile O'Neal"->"Magic"@0] | | | + | | | [:serve "Shaquile O'Neal"->"Suns"@0] | | | + | | | [:like "Yao Ming"->"Shaquile O'Neal"@0] | | | + | | | [:serve "Tony Parker"->"Hornets"@0] | | | + | | | [:serve "Tony Parker"->"Spurs"@0] | | | + | | | [:like "Boris Diaw"->"Tony Parker"@0] | | | + | | | [:like "Dejounte Murray"->"Tony Parker"@0] | | | + | | | [:like "LaMarcus Aldridge"->"Tony Parker"@0] | | | + | | | [:like "Marco Belinelli"->"Tony Parker"@0] | | | + | | | [:like "Tim Duncan"->"Tony Parker"@0] | | | + Then the result should be, in any order, with relax comparison: + | a | b | + | [("Tim Duncan")] | <[edge1]> | + | <[vertex2]> | <[edge2]> | + | <[vertex3]> | <[edge3]> | + + Scenario: yield Integer Vid two steps in and out edge + When executing query: + """ + GET SUBGRAPH WITH PROP 2 STEPS FROM hash('Tim Duncan'), hash('James Harden') IN teammate OUT serve YIELD VERTICES as a, EDGES as b + """ + Then define some list variables: + | vertex1 | edge1 | vertex2 | edge2 | vertex3 | + | ("Tim Duncan") | [:serve "Tim Duncan"->"Spurs"@0] | ("Manu Ginobili") | [:serve "Manu Ginobili"->"Spurs"@0] | ("Hornets") | + | ("James Harden") | [:teammate "Manu Ginobili"->"Tim Duncan"@0] | ("Tony Parker") | [:teammate "Tim Duncan"->"Manu Ginobili"@0] | | + | | [:teammate "Tony Parker"->"Tim Duncan"@0] | ("Spurs") | [:teammate "Tony Parker"->"Manu Ginobili"@0] | | + | | [:serve "James Harden"->"Rockets"@0] | ("Rockets") | [:serve "Tony Parker"->"Hornets"@0] | | + | | [:serve "James Harden"->"Thunders"@0] | ("Thunders") | [:serve "Tony Parker"->"Spurs"@0] | | + | | | | [:teammate "Manu Ginobili"->"Tony Parker"@0] | | + | | | | [:teammate "Tim Duncan"->"Tony Parker"@0] | | + Then the result should be, in any order, with relax comparison: + | a | b | + | <[vertex1]> | <[edge1]> | + | <[vertex2]> | <[edge2]> | + | <[vertex3]> | [] | + + Scenario: yield Integer Vid three steps + When executing query: + """ + GET SUBGRAPH WITH PROP 3 STEPS FROM hash('Paul George') OUT serve BOTH like YIELD vertices as A, EDGES as B + """ + Then define some list variables: + | edge1 | edge2 | edge3 | vertex4 | edge4 | + | [:like "Russell Westbrook"->"Paul George"@0] | [:like "Dejounte Murray"->"Russell Westbrook"@0] | [:serve "Dejounte Murray"->"Spurs"@0] | ("Kyle Anderson") | [:like "Tony Parker"->"Tim Duncan"@0] | + | [:serve "Paul George"->"Pacers"@0] | [:like "James Harden"->"Russell Westbrook"@0] | [:like "Dejounte Murray"->"Chris Paul"@0] | ("Tony Parker") | [:serve "Kyle Anderson"->"Spurs"@0] | + | [:serve "Paul George"->"Thunders"@0] | [:serve "Russell Westbrook"->"Thunders"@0] | [:like "Dejounte Murray"->"Danny Green"@0] | ("Danny Green") | [:like "Marco Belinelli"->"Danny Green"@0] | + | [:like "Paul George"->"Russell Westbrook"@0] | [:like "Russell Westbrook"->"James Harden"@0] | [:like "Dejounte Murray"->"James Harden"@0] | ("Luka Doncic") | [:like "Tony Parker"->"Manu Ginobili"@0] | + | | | [:like "Dejounte Murray"->"Kevin Durant"@0] | ("Tim Duncan") | [:serve "Tony Parker"->"Spurs"@0] | + | | | [:like "Dejounte Murray"->"Kyle Anderson"@0] | ("Marco Belinelli") | [:serve "Danny Green"->"Spurs"@0] | + | | | [:like "Dejounte Murray"->"LeBron James"@0] | ("Kevin Durant") | [:like "Danny Green"->"LeBron James"@0] | + | | | [:like "Dejounte Murray"->"Manu Ginobili"@0] | ("Manu Ginobili") | [:like "Danny Green"->"Marco Belinelli"@0] | + | | | [:like "Dejounte Murray"->"Marco Belinelli"@0] | ("Chris Paul") | [:like "Danny Green"->"Tim Duncan"@0] | + | | | [:like "Dejounte Murray"->"Tim Duncan"@0] | ("LeBron James") | [:like "Tim Duncan"->"Tony Parker"@0] | + | | | [:like "Dejounte Murray"->"Tony Parker"@0] | ("Spurs") | [:like "Marco Belinelli"->"Tony Parker"@0] | + | | | [:like "Luka Doncic"->"James Harden"@0] | ("Rockets") | [:like "Tim Duncan"->"Manu Ginobili"@0] | + | | | [:serve "James Harden"->"Rockets"@0] | | [:serve "Tim Duncan"->"Spurs"@0] | + | | | [:serve "James Harden"->"Thunders"@0] | | [:like "Marco Belinelli"->"Tim Duncan"@0] | + | | | | | [:like "Manu Ginobili"->"Tim Duncan"@0] | + | | | | | [:serve "Marco Belinelli"->"Spurs"@0] | + | | | | | [:serve "Kevin Durant"->"Thunders"@0] | + | | | | | [:serve "Marco Belinelli"->"Spurs"@1] | + | | | | | [:serve "Manu Ginobili"->"Spurs"@0] | + | | | | | [:serve "Chris Paul"->"Rockets"@0] | + | | | | | [:like "Chris Paul"->"LeBron James"@0] | + Then the result should be, in any order, with relax comparison: + | A | B | + | [("Paul George")] | <[edge1]> | + | [("Russell Westbrook"), ("Pacers"), ("Thunders")] | <[edge2]> | + | [("Dejounte Murray"), ("James Harden")] | <[edge3]> | + | <[vertex4]> | <[edge4]> | + + Scenario: yield Integer Vid bidirect edge + When executing query: + """ + GET SUBGRAPH WITH PROP FROM hash('Tony Parker') BOTH like YIELD VERTICES as nodes , EDGES as relationships + """ + Then define some list variables: + | edge1 | vertex2 | edge2 | + | [:like "Boris Diaw"->"Tony Parker"@0] | ("Manu Ginobili") | [:like "Manu Ginobili"->"Tim Duncan"@0] | + | [:like "Dejounte Murray"->"Tony Parker"@0] | ("Marco Belinelli") | [:like "Dejounte Murray"->"Marco Belinelli"@0] | + | [:like "LaMarcus Aldridge"->"Tony Parker"@0] | ("Tim Duncan") | [:like "Marco Belinelli"->"Tim Duncan"@0] | + | [:like "Marco Belinelli"->"Tony Parker"@0] | ("Dejounte Murray") | [:like "Tim Duncan"->"Manu Ginobili"@0] | + | [:like "Tim Duncan"->"Tony Parker"@0] | ("LaMarcus Aldridge") | [:like "Boris Diaw"->"Tim Duncan"@0] | + | [:like "Tony Parker"->"LaMarcus Aldridge"@0] | ("Boris Diaw") | [:like "Dejounte Murray"->"Manu Ginobili"@0] | + | [: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: + | nodes | relationships | + | [("Tony Parker")] | <[edge1]> | + | <[vertex2]> | <[edge2]> | + + Scenario: yield Integer Vid pipe + When executing query: + """ + GO FROM hash('Tim Duncan') over serve YIELD serve._src AS id | GET SUBGRAPH WITH PROP FROM $-.id YIELD vertices as nodes, edges as relationships + """ + Then define some list variables: + | edge1 | vertex2 | edge2 | + | [:teammate "Manu Ginobili"->"Tim Duncan"@0] | ("Danny Green") | [:like "Dejounte Murray"->"Danny Green"@0] | + | [:teammate "Tony Parker"->"Tim Duncan"@0] | ("Manu Ginobili") | [:like "Marco Belinelli"->"Danny Green"@0] | + | [:like "Aron Baynes"->"Tim Duncan"@0] | ("Aron Baynes") | [:like "Danny Green"->"Marco Belinelli"@0] | + | [:like "Boris Diaw"->"Tim Duncan"@0] | ("Boris Diaw") | [:serve "Danny Green"->"Spurs"@0] | + | [:like "Danny Green"->"Tim Duncan"@0] | ("Shaquile O\'Neal") | [:teammate "Tony Parker"->"Manu Ginobili"@0] | + | [:like "Dejounte Murray"->"Tim Duncan"@0] | ("Tony Parker") | [:like "Dejounte Murray"->"Manu Ginobili"@0] | + | [:like "LaMarcus Aldridge"->"Tim Duncan"@0] | ("Spurs") | [:like "Tiago Splitter"->"Manu Ginobili"@0] | + | [:like "Manu Ginobili"->"Tim Duncan"@0] | ("Dejounte Murray") | [:like "Tony Parker"->"Manu Ginobili"@0] | + | [:like "Marco Belinelli"->"Tim Duncan"@0] | ("LaMarcus Aldridge") | [:serve "Manu Ginobili"->"Spurs"@0] | + | [:like "Shaquile O\'Neal"->"Tim Duncan"@0] | ("Marco Belinelli") | [:teammate "Manu Ginobili"->"Tony Parker"@0] | + | [:like "Tiago Splitter"->"Tim Duncan"@0] | ("Tiago Splitter") | [:serve "Aron Baynes"->"Spurs"@0] | + | [:like "Tony Parker"->"Tim Duncan"@0] | | [:like "Boris Diaw"->"Tony Parker"@0] | + | [:like "Tim Duncan"->"Manu Ginobili"@0] | | [:serve "Boris Diaw"->"Spurs"@0] | + | [:like "Tim Duncan"->"Tony Parker"@0] | | [:like "Dejounte Murray"->"Tony Parker"@0] | + | [:serve "Tim Duncan"->"Spurs"@0] | | [:like "LaMarcus Aldridge"->"Tony Parker"@0] | + | [:teammate "Tim Duncan"->"Danny Green"@0] | | [:like "Marco Belinelli"->"Tony Parker"@0] | + | [:teammate "Tim Duncan"->"LaMarcus Aldridge"@0] | | [:like "Tony Parker"->"LaMarcus Aldridge"@0] | + | [:teammate "Tim Duncan"->"Manu Ginobili"@0] | | [:serve "Tony Parker"->"Spurs"@0] | + | [:teammate "Tim Duncan"->"Tony Parker"@0] | | [:teammate "Tony Parker"->"LaMarcus Aldridge"@0] | + | | | [:serve "Dejounte Murray"->"Spurs"@0] | + | | | [:serve "LaMarcus Aldridge"->"Spurs"@0] | + | | | [:serve "Marco Belinelli"->"Spurs"@0] | + | | | [:serve "Tiago Splitter"->"Spurs"@0] | + | | | [:serve "Marco Belinelli"->"Spurs"@1] | + | | | [:like "Dejounte Murray"->"Marco Belinelli"@0] | + Then the result should be, in any order, with relax comparison: + | nodes | relationships | + | [("Tim Duncan")] | <[edge1]> | + | <[vertex2]> | <[edge2]> | + + Scenario: yield Integer Vid var + When executing query: + """ + $a = GO FROM hash('Tim Duncan') over serve YIELD serve._src AS id; + GET SUBGRAPH WITH PROP FROM $a.id YIELD vertices as nodes, edges as relationships + """ + Then define some list variables: + | edge1 | vertex2 | edge2 | + | [:teammate "Manu Ginobili"->"Tim Duncan"@0] | ("Danny Green") | [:like "Dejounte Murray"->"Danny Green"@0] | + | [:teammate "Tony Parker"->"Tim Duncan"@0] | ("Manu Ginobili") | [:like "Marco Belinelli"->"Danny Green"@0] | + | [:like "Aron Baynes"->"Tim Duncan"@0] | ("Aron Baynes") | [:like "Danny Green"->"Marco Belinelli"@0] | + | [:like "Boris Diaw"->"Tim Duncan"@0] | ("Boris Diaw") | [:serve "Danny Green"->"Spurs"@0] | + | [:like "Danny Green"->"Tim Duncan"@0] | ("Shaquile O\'Neal") | [:teammate "Tony Parker"->"Manu Ginobili"@0] | + | [:like "Dejounte Murray"->"Tim Duncan"@0] | ("Tony Parker") | [:like "Dejounte Murray"->"Manu Ginobili"@0] | + | [:like "LaMarcus Aldridge"->"Tim Duncan"@0] | ("Spurs") | [:like "Tiago Splitter"->"Manu Ginobili"@0] | + | [:like "Manu Ginobili"->"Tim Duncan"@0] | ("Dejounte Murray") | [:like "Tony Parker"->"Manu Ginobili"@0] | + | [:like "Marco Belinelli"->"Tim Duncan"@0] | ("LaMarcus Aldridge") | [:serve "Manu Ginobili"->"Spurs"@0] | + | [:like "Shaquile O\'Neal"->"Tim Duncan"@0] | ("Marco Belinelli") | [:teammate "Manu Ginobili"->"Tony Parker"@0] | + | [:like "Tiago Splitter"->"Tim Duncan"@0] | ("Tiago Splitter") | [:serve "Aron Baynes"->"Spurs"@0] | + | [:like "Tony Parker"->"Tim Duncan"@0] | | [:like "Boris Diaw"->"Tony Parker"@0] | + | [:like "Tim Duncan"->"Manu Ginobili"@0] | | [:serve "Boris Diaw"->"Spurs"@0] | + | [:like "Tim Duncan"->"Tony Parker"@0] | | [:like "Dejounte Murray"->"Tony Parker"@0] | + | [:serve "Tim Duncan"->"Spurs"@0] | | [:like "LaMarcus Aldridge"->"Tony Parker"@0] | + | [:teammate "Tim Duncan"->"Danny Green"@0] | | [:like "Marco Belinelli"->"Tony Parker"@0] | + | [:teammate "Tim Duncan"->"LaMarcus Aldridge"@0] | | [:like "Tony Parker"->"LaMarcus Aldridge"@0] | + | [:teammate "Tim Duncan"->"Manu Ginobili"@0] | | [:serve "Tony Parker"->"Spurs"@0] | + | [:teammate "Tim Duncan"->"Tony Parker"@0] | | [:teammate "Tony Parker"->"LaMarcus Aldridge"@0] | + | | | [:serve "Dejounte Murray"->"Spurs"@0] | + | | | [:serve "LaMarcus Aldridge"->"Spurs"@0] | + | | | [:serve "Marco Belinelli"->"Spurs"@0] | + | | | [:serve "Tiago Splitter"->"Spurs"@0] | + | | | [:serve "Marco Belinelli"->"Spurs"@1] | + | | | [:like "Dejounte Murray"->"Marco Belinelli"@0] | + Then the result should be, in any order, with relax comparison: + | nodes | relationships | + | [("Tim Duncan")] | <[edge1]> | + | <[vertex2]> | <[edge2]> | + + Scenario: yield Integer Vid many steps + When executing query: + """ + GET SUBGRAPH WITH PROP 4 STEPS FROM hash('Yao Ming') IN teammate OUT serve YIELD vertices as a, edges as b + """ + Then the result should be, in any order, with relax comparison: + | a | b | + | [("Yao Ming")] | [[:serve "Yao Ming"->"Rockets"@0]] | + | [("Rockets")] | [] | + When executing query: + """ + GET SUBGRAPH WITH PROP 4 STEPS FROM hash('NOBODY') IN teammate OUT serve YIELD VERTICES as a, EDGES as b + """ + Then the result should be, in any order, with relax comparison: + | a | b | + | [("NOBODY")] | [] | + When executing query: + """ + GET SUBGRAPH WITH PROP 4 steps from hash('Yao Ming') IN teammate OUT serve BOTH like YIELD VERTiCeS as nodes , EDgES as relationships + """ + Then define some list variables: + | edge1 | vertex2 | edge2 | vertex3 | edge3 | vertex4 | edge4 | vertex5 | edge5 | + | [:serve "Yao Ming"->"Rockets"@0] | ("Shaquile O'Neal") | [:serve "Shaquile O'Neal"->"Cavaliers"@0] | ("Kobe Bryant") | [:serve "Kobe Bryant"->"Lakers"@0] | ("Manu Ginobili") | [:serve "Manu Ginobili"->"Spurs"@0] | ("Dirk Nowitzki") | [:like "Dirk Nowitzki"->"Steve Nash"@0] | + | [:like "Yao Ming"->"Shaquile O'Neal"@0] | ("Tracy McGrady") | [:serve "Shaquile O'Neal"->"Celtics"@0] | ("Grant Hill") | [:like "Paul Gasol"->"Kobe Bryant"@0] | ("Paul Gasol") | [:teammate "Tim Duncan"->"Manu Ginobili"@0] | ("Kevin Durant") | [:serve "Kevin Durant"->"Warriors"@0] | + | [:like "Yao Ming"->"Tracy McGrady"@0] | ("Rockets") | [:serve "Shaquile O'Neal"->"Heat"@0] | ("Vince Carter") | [:serve "Grant Hill"->"Clippers"@0] | ("Jason Kidd") | [:teammate "Tony Parker"->"Manu Ginobili"@0] | ("Damian Lillard") | [:serve "Damian Lillard"->"Trail Blazers"@0] | + | | | [:serve "Shaquile O'Neal"->"Lakers"@0] | ("Tim Duncan") | [:serve "Grant Hill"->"Magic"@0] | ("Tony Parker") | [:like "Dejounte Murray"->"Manu Ginobili"@0] | ("James Harden") | [:serve "James Harden"->"Rockets"@0] | + | | | [:serve "Shaquile O'Neal"->"Magic"@0] | ("JaVale McGee") | [:serve "Grant Hill"->"Pistons"@0] | ("Marco Belinelli") | [:like "Tiago Splitter"->"Manu Ginobili"@0] | ("Chris Paul") | [:like "Steve Nash"->"Dirk Nowitzki"@0] | + | | | [:serve "Shaquile O'Neal"->"Suns"@0] | ("Rudy Gay") | [:serve "Grant Hill"->"Suns"@0] | ("Dejounte Murray") | [:like "Tony Parker"->"Manu Ginobili"@0] | ("LeBron James") | [:like "Russell Westbrook"->"James Harden"@0] | + | | | [:like "Shaquile O'Neal"->"JaVale McGee"@0] | ("Magic") | [:serve "Vince Carter"->"Grizzlies"@0] | ("Aron Baynes") | [:serve "Paul Gasol"->"Bucks"@0] | ("Steve Nash") | [:like "James Harden"->"Russell Westbrook"@0] | + | | | [:like "Shaquile O'Neal"->"Tim Duncan"@0] | ("Spurs") | [:serve "Vince Carter"->"Hawks"@0] | ("Boris Diaw") | [:serve "Paul Gasol"->"Bulls"@0] | ("Marc Gasol") | [:serve "Chris Paul"->"Clippers"@0] | + | | | [:serve "Tracy McGrady"->"Magic"@0] | ("Celtics") | [:serve "Vince Carter"->"Kings"@0] | ("Danny Green") | [:serve "Paul Gasol"->"Grizzlies"@0] | ("Kyle Anderson") | [:serve "Chris Paul"->"Hornets"@0] | + | | | [:serve "Tracy McGrady"->"Raptors"@0] | ("Heat") | [:serve "Vince Carter"->"Magic"@0] | ("LaMarcus Aldridge") | [:serve "Paul Gasol"->"Lakers"@0] | ("Russell Westbrook") | [:serve "Chris Paul"->"Rockets"@0] | + | | | [:serve "Tracy McGrady"->"Rockets"@0] | ("Suns") | [:serve "Vince Carter"->"Mavericks"@0] | ("Tiago Splitter") | [:serve "Paul Gasol"->"Spurs"@0] | ("76ers") | [:serve "Dirk Nowitzki"->"Mavericks"@0] | + | | | [:serve "Tracy McGrady"->"Spurs"@0] | ("Lakers") | [:serve "Vince Carter"->"Nets"@0] | ("Pistons") | [:like "Marc Gasol"->"Paul Gasol"@0] | ("Hornets") | [:like "Chris Paul"->"LeBron James"@0] | + | | | [:like "Grant Hill"->"Tracy McGrady"@0] | ("Cavaliers") | [:serve "Vince Carter"->"Raptors"@0] | ("Nets") | [:like "Paul Gasol"->"Marc Gasol"@0] | ("Bucks") | [:serve "Steve Nash"->"Lakers"@0] | + | | | [:like "Vince Carter"->"Tracy McGrady"@0] | ("Raptors") | [:serve "Vince Carter"->"Suns"@0] | ("Kings") | [:serve "Jason Kidd"->"Knicks"@0] | ("Knicks") | [:serve "Steve Nash"->"Mavericks"@0] | + | | | [:like "Tracy McGrady"->"Grant Hill"@0] | | [:like "Jason Kidd"->"Vince Carter"@0] | ("Clippers") | [:serve "Jason Kidd"->"Mavericks"@0] | ("Bulls") | [:serve "Steve Nash"->"Suns"@0] | + | | | [:like "Tracy McGrady"->"Kobe Bryant"@0] | | [:like "Vince Carter"->"Jason Kidd"@0] | ("Mavericks") | [:serve "Jason Kidd"->"Nets"@0] | ("Trail Blazers") | [:serve "Steve Nash"->"Suns"@1] | + | | | [:like "Tracy McGrady"->"Rudy Gay"@0] | | [:serve "Tim Duncan"->"Spurs"@0] | ("Hawks") | [:serve "Jason Kidd"->"Suns"@0] | ("Jazz") | [:serve "LeBron James"->"Cavaliers"@1] | + | | | | | [:teammate "Manu Ginobili"->"Tim Duncan"@0] | ("Warriors") | [:serve "Jason Kidd"->"Mavericks"@1] | | [:serve "LeBron James"->"Lakers"@0] | + | | | | | [:teammate "Tony Parker"->"Tim Duncan"@0] | ("Nuggets") | [:like "Dirk Nowitzki"->"Jason Kidd"@0] | | [:serve "LeBron James"->"Heat"@0] | + | | | | | [:like "Aron Baynes"->"Tim Duncan"@0] | ("Grizzlies") | [:like "Steve Nash"->"Jason Kidd"@0] | | [:serve "Marc Gasol"->"Grizzlies"@0] | + | | | | | [:like "Boris Diaw"->"Tim Duncan"@0] | ("Wizards") | [:like "Jason Kidd"->"Dirk Nowitzki"@0] | | [:serve "Marc Gasol"->"Raptors"@0] | + | | | | | [:like "Danny Green"->"Tim Duncan"@0] | | [:like "Jason Kidd"->"Steve Nash"@0] | | [:serve "Kyle Anderson"->"Grizzlies"@0] | + | | | | | [:like "Dejounte Murray"->"Tim Duncan"@0] | | [:serve "Tony Parker"->"Hornets"@0] | | [:serve "Kyle Anderson"->"Spurs"@0] | + | | | | | [:like "LaMarcus Aldridge"->"Tim Duncan"@0] | | [:serve "Tony Parker"->"Spurs"@0] | | [:teammate "Tony Parker"->"Kyle Anderson"@0] | + | | | | | [:like "Manu Ginobili"->"Tim Duncan"@0] | | [:teammate "Manu Ginobili"->"Tony Parker"@0] | | [:serve "LeBron James"->"Cavaliers"@0] | + | | | | | [:like "Marco Belinelli"->"Tim Duncan"@0] | | [:teammate "Tim Duncan"->"Tony Parker"@0] | | | + | | | | | [:like "Tiago Splitter"->"Tim Duncan"@0] | | [:like "Boris Diaw"->"Tony Parker"@0] | | | + | | | | | [:like "Tony Parker"->"Tim Duncan"@0] | | [:like "Dejounte Murray"->"Tony Parker"@0] | | | + | | | | | [:like "Tim Duncan"->"Manu Ginobili"@0] | | [:like "LaMarcus Aldridge"->"Tony Parker"@0] | | | + | | | | | [:like "Tim Duncan"->"Tony Parker"@0] | | [:like "Marco Belinelli"->"Tony Parker"@0] | | | + | | | | | [:serve "JaVale McGee"->"Lakers"@0] | | [:like "Tony Parker"->"LaMarcus Aldridge"@0] | | | + | | | | | [:serve "JaVale McGee"->"Mavericks"@0] | | [:serve "Marco Belinelli"->"76ers"@0] | | | + | | | | | [:serve "JaVale McGee"->"Nuggets"@0] | | [:serve "Marco Belinelli"->"Bulls"@0] | | | + | | | | | [:serve "JaVale McGee"->"Warriors"@0] | | [:serve "Marco Belinelli"->"Hawks"@0] | | | + | | | | | [:serve "JaVale McGee"->"Wizards"@0] | | [:serve "Marco Belinelli"->"Hornets"@0] | | | + | | | | | [:serve "Rudy Gay"->"Grizzlies"@0] | | [:serve "Marco Belinelli"->"Kings"@0] | | | + | | | | | [:serve "Rudy Gay"->"Kings"@0] | | [:serve "Marco Belinelli"->"Raptors"@0] | | | + | | | | | [:serve "Rudy Gay"->"Raptors"@0] | | [:serve "Marco Belinelli"->"Spurs"@0] | | | + | | | | | [:serve "Rudy Gay"->"Spurs"@0] | | [:serve "Marco Belinelli"->"Warriors"@0] | | | + | | | | | [:like "Rudy Gay"->"LaMarcus Aldridge"@0] | | [:serve "Marco Belinelli"->"Hornets"@1] | | | + | | | | | | | [:serve "Marco Belinelli"->"Spurs"@1] | | | + | | | | | | | [:like "Danny Green"->"Marco Belinelli"@0] | | | + | | | | | | | [:like "Dejounte Murray"->"Marco Belinelli"@0] | | | + | | | | | | | [:like "Marco Belinelli"->"Danny Green"@0] | | | + | | | | | | | [:serve "Dejounte Murray"->"Spurs"@0] | | | + | | | | | | | [:like "Dejounte Murray"->"Chris Paul"@0] | | | + | | | | | | | [:like "Dejounte Murray"->"Danny Green"@0] | | | + | | | | | | | [:like "Dejounte Murray"->"James Harden"@0] | | | + | | | | | | | [:like "Dejounte Murray"->"Kevin Durant"@0] | | | + | | | | | | | [:like "Dejounte Murray"->"Kyle Anderson"@0] | | | + | | | | | | | [:like "Dejounte Murray"->"LeBron James"@0] | | | + | | | | | | | [:like "Dejounte Murray"->"Russell Westbrook"@0] | | | + | | | | | | | [:serve "Aron Baynes"->"Celtics"@0] | | | + | | | | | | | [:serve "Aron Baynes"->"Pistons"@0] | | | + | | | | | | | [:serve "Aron Baynes"->"Spurs"@0] | | | + | | | | | | | [:serve "Boris Diaw"->"Hawks"@0] | | | + | | | | | | | [:serve "Boris Diaw"->"Hornets"@0] | | | + | | | | | | | [:serve "Boris Diaw"->"Jazz"@0] | | | + | | | | | | | [:serve "Boris Diaw"->"Spurs"@0] | | | + | | | | | | | [:serve "Boris Diaw"->"Suns"@0] | | | + | | | | | | | [:serve "Danny Green"->"Cavaliers"@0] | | | + | | | | | | | [:serve "Danny Green"->"Raptors"@0] | | | + | | | | | | | [:serve "Danny Green"->"Spurs"@0] | | | + | | | | | | | [:teammate "Tim Duncan"->"Danny Green"@0] | | | + | | | | | | | [:like "Danny Green"->"LeBron James"@0] | | | + | | | | | | | [:serve "LaMarcus Aldridge"->"Spurs"@0] | | | + | | | | | | | [:serve "LaMarcus Aldridge"->"Trail Blazers"@0] | | | + | | | | | | | [:teammate "Tim Duncan"->"LaMarcus Aldridge"@0] | | | + | | | | | | | [:teammate "Tony Parker"->"LaMarcus Aldridge"@0] | | | + | | | | | | | [:like "Damian Lillard"->"LaMarcus Aldridge"@0] | | | + | | | | | | | [:serve "Tiago Splitter"->"76ers"@0] | | | + | | | | | | | [:serve "Tiago Splitter"->"Hawks"@0] | | | + | | | | | | | [:serve "Tiago Splitter"->"Spurs"@0] | | | + Then the result should be, in any order, with relax comparison: + | nodes | relationships | + | [("Yao Ming")] | <[edge1]> | + | <[vertex2]> | <[edge2]> | + | <[vertex3]> | <[edge3]> | + | <[vertex4]> | <[edge4]> | + | <[vertex5]> | <[edge5]> | + When executing query: + """ + GET SUBGRAPH WITH PROP 5 steps from hash('Tony Parker') IN teammate OUT serve BOTH like YIELD VERTICES as a, EDGES as b + """ + Then define some list variables: + | edge1 | vertex2 | edge2 | vertex3 | edge3 | vertex4 | edge4 | vertex5 | edge5 | vertex6 | edge6 | + | [:serve "Tony Parker"->"Hornets"@0] | ("Tim Duncan") | [:serve "Tim Duncan"->"Spurs"@0] | ("Aron Baynes") | [:serve "Aron Baynes"->"Celtics"@0] | ("Yao Ming") | [:serve "Yao Ming"->"Rockets"@0] | ("Grant Hill") | [:serve "Grant Hill"->"Clippers"@0] | ("Steve Nash") | [:serve "Steve Nash"->"Lakers"@0] | + | [:serve "Tony Parker"->"Spurs"@0] | ("Boris Diaw") | [:teammate "Manu Ginobili"->"Tim Duncan"@0] | ("Rudy Gay") | [:serve "Aron Baynes"->"Pistons"@0] | ("Ray Allen") | [:like "Yao Ming"->"Tracy McGrady"@0] | ("Kristaps Porzingis") | [:serve "Grant Hill"->"Magic"@0] | ("Paul Gasol") | [:serve "Steve Nash"->"Mavericks"@0] | + | [:teammate "Manu Ginobili"->"Tony Parker"@0] | ("LaMarcus Aldridge") | [:teammate "Tony Parker"->"Tim Duncan"@0] | ("Damian Lillard") | [:serve "Aron Baynes"->"Spurs"@0] | ("Blake Griffin") | [:serve "Ray Allen"->"Bucks"@0] | ("Dirk Nowitzki") | [:serve "Grant Hill"->"Pistons"@0] | ("Jason Kidd") | [:serve "Steve Nash"->"Suns"@0] | + | [:teammate "Tim Duncan"->"Tony Parker"@0] | ("Manu Ginobili") | [:like "Aron Baynes"->"Tim Duncan"@0] | ("Kevin Durant") | [:serve "Rudy Gay"->"Grizzlies"@0] | ("Paul George") | [:serve "Ray Allen"->"Celtics"@0] | ("Rajon Rondo") | [:serve "Grant Hill"->"Suns"@0] | ("Pelicans") | [:serve "Steve Nash"->"Suns"@1] | + | [:like "Boris Diaw"->"Tony Parker"@0] | ("Marco Belinelli") | [:like "Boris Diaw"->"Tim Duncan"@0] | ("Shaquile O'Neal") | [:serve "Rudy Gay"->"Kings"@0] | ("JaVale McGee") | [:serve "Ray Allen"->"Heat"@0] | ("Vince Carter") | [:serve "Kristaps Porzingis"->"Knicks"@0] | ("Nets") | [:like "Jason Kidd"->"Steve Nash"@0] | + | [:like "Dejounte Murray"->"Tony Parker"@0] | ("Dejounte Murray") | [:like "Danny Green"->"Tim Duncan"@0] | ("Tiago Splitter") | [:serve "Rudy Gay"->"Raptors"@0] | ("Luka Doncic") | [:serve "Ray Allen"->"Thunders"@0] | ("Kobe Bryant") | [:serve "Kristaps Porzingis"->"Mavericks"@0] | | [:serve "Paul Gasol"->"Spurs"@0] | + | [:like "LaMarcus Aldridge"->"Tony Parker"@0] | ("Hornets") | [:like "Dejounte Murray"->"Tim Duncan"@0] | ("Russell Westbrook") | [:serve "Rudy Gay"->"Spurs"@0] | ("Carmelo Anthony") | [:like "Rajon Rondo"->"Ray Allen"@0] | ("Wizards") | [:serve "Dirk Nowitzki"->"Mavericks"@0] | | [:like "Steve Nash"->"Jason Kidd"@0] | + | [:like "Marco Belinelli"->"Tony Parker"@0] | ("Spurs") | [:like "LaMarcus Aldridge"->"Tim Duncan"@0] | ("Danny Green") | [:like "Tracy McGrady"->"Rudy Gay"@0] | ("Tracy McGrady") | [:like "Ray Allen"->"Rajon Rondo"@0] | ("Pacers") | [:like "Jason Kidd"->"Dirk Nowitzki"@0] | | [:serve "Paul Gasol"->"Lakers"@0] | + | [:like "Tim Duncan"->"Tony Parker"@0] | | [:like "Manu Ginobili"->"Tim Duncan"@0] | ("Kyle Anderson") | [:serve "Damian Lillard"->"Trail Blazers"@0] | ("Dwyane Wade") | [:serve "Blake Griffin"->"Clippers"@0] | ("Knicks") | [:like "Steve Nash"->"Dirk Nowitzki"@0] | | [:serve "Jason Kidd"->"Knicks"@0] | + | [:like "Tony Parker"->"LaMarcus Aldridge"@0] | | [:like "Marco Belinelli"->"Tim Duncan"@0] | ("James Harden") | [:serve "Kevin Durant"->"Thunders"@0] | ("Kyrie Irving") | [:serve "Blake Griffin"->"Pistons"@0] | ("Bucks") | [:like "Dirk Nowitzki"->"Jason Kidd"@0] | | [:serve "Jason Kidd"->"Mavericks"@0] | + | [:like "Tony Parker"->"Manu Ginobili"@0] | | [:like "Shaquile O'Neal"->"Tim Duncan"@0] | ("LeBron James") | [:serve "Kevin Durant"->"Warriors"@0] | ("Cavaliers") | [:serve "Paul George"->"Pacers"@0] | ("Mavericks") | [:like "Dirk Nowitzki"->"Steve Nash"@0] | | [:serve "Jason Kidd"->"Nets"@0] | + | [:like "Tony Parker"->"Tim Duncan"@0] | | [:like "Tiago Splitter"->"Tim Duncan"@0] | ("Chris Paul") | [:serve "Shaquile O'Neal"->"Cavaliers"@0] | ("Celtics") | [:serve "Paul George"->"Thunders"@0] | ("Nuggets") | [:serve "Rajon Rondo"->"Bulls"@0] | | [:serve "Jason Kidd"->"Suns"@0] | + | | | [:like "Tim Duncan"->"Manu Ginobili"@0] | ("Bulls") | [:serve "Shaquile O'Neal"->"Celtics"@0] | ("Pistons") | [:serve "JaVale McGee"->"Lakers"@0] | | [:serve "Rajon Rondo"->"Celtics"@0] | | [:serve "Jason Kidd"->"Mavericks"@1] | + | | | [:serve "Boris Diaw"->"Hawks"@0] | ("Jazz") | [:serve "Shaquile O'Neal"->"Heat"@0] | ("Grizzlies") | [:serve "JaVale McGee"->"Mavericks"@0] | | [:serve "Rajon Rondo"->"Kings"@0] | | [:serve "Paul Gasol"->"Bucks"@0] | + | | | [:serve "Boris Diaw"->"Hornets"@0] | ("Hawks") | [:serve "Shaquile O'Neal"->"Lakers"@0] | ("Heat") | [:serve "JaVale McGee"->"Nuggets"@0] | | [:serve "Rajon Rondo"->"Lakers"@0] | | [:serve "Paul Gasol"->"Bulls"@0] | + | | | [:serve "Boris Diaw"->"Jazz"@0] | ("Warriors") | [:serve "Shaquile O'Neal"->"Magic"@0] | ("Magic") | [:serve "JaVale McGee"->"Warriors"@0] | | [:serve "Rajon Rondo"->"Mavericks"@0] | | [:serve "Paul Gasol"->"Grizzlies"@0] | + | | | [:serve "Boris Diaw"->"Spurs"@0] | ("Suns") | [:serve "Shaquile O'Neal"->"Suns"@0] | ("Lakers") | [:serve "JaVale McGee"->"Wizards"@0] | | [:serve "Rajon Rondo"->"Pelicans"@0] | | | + | | | [:serve "Boris Diaw"->"Suns"@0] | ("Trail Blazers") | [:like "Yao Ming"->"Shaquile O'Neal"@0] | ("Clippers") | [:serve "Luka Doncic"->"Mavericks"@0] | | [:serve "Vince Carter"->"Grizzlies"@0] | | | + | | | [:serve "LaMarcus Aldridge"->"Spurs"@0] | ("Kings") | [:like "Shaquile O'Neal"->"JaVale McGee"@0] | ("Thunders") | [:like "Kristaps Porzingis"->"Luka Doncic"@0] | | [:serve "Vince Carter"->"Hawks"@0] | | | + | | | [:serve "LaMarcus Aldridge"->"Trail Blazers"@0] | ("Raptors") | [:serve "Tiago Splitter"->"76ers"@0] | ("Rockets") | [:like "Luka Doncic"->"Dirk Nowitzki"@0] | | [:serve "Vince Carter"->"Kings"@0] | | | + | | | [:teammate "Tim Duncan"->"LaMarcus Aldridge"@0] | ("76ers") | [:serve "Tiago Splitter"->"Hawks"@0] | | [:like "Luka Doncic"->"Kristaps Porzingis"@0] | | [:serve "Vince Carter"->"Magic"@0] | | | + | | | [:teammate "Tony Parker"->"LaMarcus Aldridge"@0] | | [:serve "Tiago Splitter"->"Spurs"@0] | | [:serve "Carmelo Anthony"->"Knicks"@0] | | [:serve "Vince Carter"->"Mavericks"@0] | | | + | | | [:like "Damian Lillard"->"LaMarcus Aldridge"@0] | | [:serve "Russell Westbrook"->"Thunders"@0] | | [:serve "Carmelo Anthony"->"Nuggets"@0] | | [:serve "Vince Carter"->"Nets"@0] | | | + | | | [:like "Rudy Gay"->"LaMarcus Aldridge"@0] | | [:like "James Harden"->"Russell Westbrook"@0] | | [:serve "Carmelo Anthony"->"Rockets"@0] | | [:serve "Vince Carter"->"Raptors"@0] | | | + | | | [:serve "Manu Ginobili"->"Spurs"@0] | | [:like "Paul George"->"Russell Westbrook"@0] | | [:serve "Carmelo Anthony"->"Thunders"@0] | | [:serve "Vince Carter"->"Suns"@0] | | | + | | | [:teammate "Tim Duncan"->"Manu Ginobili"@0] | | [:like "Russell Westbrook"->"James Harden"@0] | | [:like "Dwyane Wade"->"Carmelo Anthony"@0] | | [:like "Jason Kidd"->"Vince Carter"@0] | | | + | | | [:teammate "Tony Parker"->"Manu Ginobili"@0] | | [:like "Russell Westbrook"->"Paul George"@0] | | [:like "Carmelo Anthony"->"Dwyane Wade"@0] | | [:like "Vince Carter"->"Jason Kidd"@0] | | | + | | | [:like "Dejounte Murray"->"Manu Ginobili"@0] | | [:serve "Danny Green"->"Cavaliers"@0] | | [:serve "Tracy McGrady"->"Magic"@0] | | [:serve "Kobe Bryant"->"Lakers"@0] | | | + | | | [:like "Tiago Splitter"->"Manu Ginobili"@0] | | [:serve "Danny Green"->"Raptors"@0] | | [:serve "Tracy McGrady"->"Raptors"@0] | | [:like "Paul Gasol"->"Kobe Bryant"@0] | | | + | | | [:serve "Marco Belinelli"->"76ers"@0] | | [:serve "Danny Green"->"Spurs"@0] | | [:serve "Tracy McGrady"->"Rockets"@0] | | | | | + | | | [:serve "Marco Belinelli"->"Bulls"@0] | | [:teammate "Tim Duncan"->"Danny Green"@0] | | [:serve "Tracy McGrady"->"Spurs"@0] | | | | | + | | | [:serve "Marco Belinelli"->"Hawks"@0] | | [:like "Danny Green"->"LeBron James"@0] | | [:like "Grant Hill"->"Tracy McGrady"@0] | | | | | + | | | [:serve "Marco Belinelli"->"Hornets"@0] | | [:serve "Kyle Anderson"->"Grizzlies"@0] | | [:like "Vince Carter"->"Tracy McGrady"@0] | | | | | + | | | [:serve "Marco Belinelli"->"Kings"@0] | | [:serve "Kyle Anderson"->"Spurs"@0] | | [:like "Tracy McGrady"->"Grant Hill"@0] | | | | | + | | | [:serve "Marco Belinelli"->"Raptors"@0] | | [:teammate "Tony Parker"->"Kyle Anderson"@0] | | [:like "Tracy McGrady"->"Kobe Bryant"@0] | | | | | + | | | [:serve "Marco Belinelli"->"Spurs"@0] | | [:serve "James Harden"->"Rockets"@0] | | [:serve "Dwyane Wade"->"Bulls"@0] | | | | | + | | | [:serve "Marco Belinelli"->"Warriors"@0] | | [:serve "James Harden"->"Thunders"@0] | | [:serve "Dwyane Wade"->"Cavaliers"@0] | | | | | + | | | [:serve "Marco Belinelli"->"Hornets"@1] | | [:like "Luka Doncic"->"James Harden"@0] | | [:serve "Dwyane Wade"->"Heat"@0] | | | | | + | | | [:serve "Marco Belinelli"->"Spurs"@1] | | [:serve "LeBron James"->"Cavaliers"@0] | | [:serve "Dwyane Wade"->"Heat"@1] | | | | | + | | | [:like "Danny Green"->"Marco Belinelli"@0] | | [:serve "LeBron James"->"Heat"@0] | | [:like "Dirk Nowitzki"->"Dwyane Wade"@0] | | | | | + | | | [:like "Dejounte Murray"->"Marco Belinelli"@0] | | [:serve "LeBron James"->"Lakers"@0] | | [:serve "Kyrie Irving"->"Cavaliers"@0] | | | | | + | | | [:like "Marco Belinelli"->"Danny Green"@0] | | [:serve "LeBron James"->"Cavaliers"@1] | | [:serve "Kyrie Irving"->"Celtics"@0] | | | | | + | | | [:serve "Dejounte Murray"->"Spurs"@0] | | [:like "Carmelo Anthony"->"LeBron James"@0] | | | | | | | + | | | [:like "Dejounte Murray"->"Chris Paul"@0] | | [:like "Chris Paul"->"LeBron James"@0] | | | | | | | + | | | [:like "Dejounte Murray"->"Danny Green"@0] | | [:like "Dwyane Wade"->"LeBron James"@0] | | | | | | | + | | | [:like "Dejounte Murray"->"James Harden"@0] | | [:like "Kyrie Irving"->"LeBron James"@0] | | | | | | | + | | | [:like "Dejounte Murray"->"Kevin Durant"@0] | | [:like "LeBron James"->"Ray Allen"@0] | | | | | | | + | | | [:like "Dejounte Murray"->"Kyle Anderson"@0] | | [:serve "Chris Paul"->"Clippers"@0] | | | | | | | + | | | [:like "Dejounte Murray"->"LeBron James"@0] | | [:serve "Chris Paul"->"Hornets"@0] | | | | | | | + | | | [:like "Dejounte Murray"->"Russell Westbrook"@0] | | [:serve "Chris Paul"->"Rockets"@0] | | | | | | | + | | | | | [:like "Blake Griffin"->"Chris Paul"@0] | | | | | | | + | | | | | [:like "Carmelo Anthony"->"Chris Paul"@0] | | | | | | | + | | | | | [:like "Dwyane Wade"->"Chris Paul"@0] | | | | | | | + | | | | | [:like "Chris Paul"->"Carmelo Anthony"@0] | | | | | | | + | | | | | [:like "Chris Paul"->"Dwyane Wade"@0] | | | | | | | + Then the result should be, in any order, with relax comparison: + | a | b | + | [("Tony Parker")] | <[edge1]> | + | <[vertex2]> | <[edge2]> | + | <[vertex3]> | <[edge3]> | + | <[vertex4]> | <[edge4]> | + | <[vertex5]> | <[edge5]> | + | <[vertex6]> | <[edge6]> | + When executing query: + """ + GET SUBGRAPH WITH PROP 4 steps from hash('Tim Duncan') BOTH like YIELD vertices as nodes, edges as relationships + """ + Then define some list variables: + | edge1 | vertex2 | edge2 | vertex3 | edge3 | vertex4 | edge4 | vertex5 | + | [:like "Aron Baynes"->"Tim Duncan"@0] | ("LaMarcus Aldridge") | [:like "Damian Lillard"->"LaMarcus Aldridge"@0] | ("Kevin Durant") | [:like "Luka Doncic"->"James Harden"@0] | ("Tracy McGrady") | [:like "Grant Hill"->"Tracy McGrady"@0] | ("Kobe Bryant") | + | [:like "Boris Diaw"->"Tim Duncan"@0] | ("Boris Diaw") | [:like "Rudy Gay"->"LaMarcus Aldridge"@0] | ("James Harden") | [:like "Russell Westbrook"->"James Harden"@0] | ("Carmelo Anthony") | [:like "Vince Carter"->"Tracy McGrady"@0] | ("Dirk Nowitzki") | + | [:like "Danny Green"->"Tim Duncan"@0] | ("Dejounte Murray") | [:like "Tony Parker"->"LaMarcus Aldridge"@0] | ("Chris Paul") | [:like "James Harden"->"Russell Westbrook"@0] | ("Luka Doncic") | [:like "Tracy McGrady"->"Grant Hill"@0] | ("Grant Hill") | + | [:like "Dejounte Murray"->"Tim Duncan"@0] | ("Danny Green") | [:like "LaMarcus Aldridge"->"Tony Parker"@0] | ("Damian Lillard") | [:like "Blake Griffin"->"Chris Paul"@0] | ("Blake Griffin") | [:like "Tracy McGrady"->"Kobe Bryant"@0] | ("Vince Carter") | + | [:like "LaMarcus Aldridge"->"Tim Duncan"@0] | ("Marco Belinelli") | [:like "Boris Diaw"->"Tony Parker"@0] | ("Rudy Gay") | [:like "Carmelo Anthony"->"Chris Paul"@0] | ("Dwyane Wade") | [:like "Dwyane Wade"->"Carmelo Anthony"@0] | ("Rajon Rondo") | + | [:like "Manu Ginobili"->"Tim Duncan"@0] | ("Aron Baynes") | [:like "Dejounte Murray"->"Chris Paul"@0] | ("Kyle Anderson") | [:like "Dwyane Wade"->"Chris Paul"@0] | ("Kyrie Irving") | [:like "Carmelo Anthony"->"Dwyane Wade"@0] | ("Kristaps Porzingis") | + | [:like "Marco Belinelli"->"Tim Duncan"@0] | ("Manu Ginobili") | [:like "Dejounte Murray"->"Danny Green"@0] | ("LeBron James") | [:like "Chris Paul"->"Carmelo Anthony"@0] | ("Ray Allen") | [:like "Kristaps Porzingis"->"Luka Doncic"@0] | | + | [:like "Shaquile O'Neal"->"Tim Duncan"@0] | ("Tiago Splitter") | [:like "Dejounte Murray"->"James Harden"@0] | ("Russell Westbrook") | [:like "Chris Paul"->"Dwyane Wade"@0] | ("Paul George") | [:like "Luka Doncic"->"Dirk Nowitzki"@0] | | + | [:like "Tiago Splitter"->"Tim Duncan"@0] | ("Shaquile O'Neal") | [:like "Dejounte Murray"->"Kevin Durant"@0] | ("Yao Ming") | [:like "Chris Paul"->"LeBron James"@0] | | [:like "Luka Doncic"->"Kristaps Porzingis"@0] | | + | [:like "Tony Parker"->"Tim Duncan"@0] | ("Tony Parker") | [:like "Dejounte Murray"->"Kyle Anderson"@0] | ("JaVale McGee") | [:like "Tracy McGrady"->"Rudy Gay"@0] | | [:like "Dirk Nowitzki"->"Dwyane Wade"@0] | | + | [:like "Tim Duncan"->"Manu Ginobili"@0] | | [:like "Dejounte Murray"->"LeBron James"@0] | | [:like "Carmelo Anthony"->"LeBron James"@0] | | [:like "Rajon Rondo"->"Ray Allen"@0] | | + | [:like "Tim Duncan"->"Tony Parker"@0] | | [:like "Dejounte Murray"->"Manu Ginobili"@0] | | [:like "Dwyane Wade"->"LeBron James"@0] | | [:like "Ray Allen"->"Rajon Rondo"@0] | | + | | | [:like "Dejounte Murray"->"Marco Belinelli"@0] | | [:like "Kyrie Irving"->"LeBron James"@0] | | | | + | | | [:like "Dejounte Murray"->"Russell Westbrook"@0] | | [:like "LeBron James"->"Ray Allen"@0] | | | | + | | | [:like "Dejounte Murray"->"Tony Parker"@0] | | [:like "Paul George"->"Russell Westbrook"@0] | | | | + | | | [:like "Marco Belinelli"->"Danny Green"@0] | | [:like "Russell Westbrook"->"Paul George"@0] | | | | + | | | [:like "Danny Green"->"LeBron James"@0] | | [:like "Yao Ming"->"Tracy McGrady"@0] | | | | + | | | [:like "Danny Green"->"Marco Belinelli"@0] | | | | | | + | | | [:like "Marco Belinelli"->"Tony Parker"@0] | | | | | | + | | | [:like "Tiago Splitter"->"Manu Ginobili"@0] | | | | | | + | | | [:like "Tony Parker"->"Manu Ginobili"@0] | | | | | | + | | | [: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: + | nodes | relationships | + | [("Tim Duncan")] | <[edge1]> | + | <[vertex2]> | <[edge2]> | + | <[vertex3]> | <[edge3]> | + | <[vertex4]> | <[edge4]> | + | <[vertex5]> | [] | + + Scenario: yield Integer Vid over end + When executing query: + """ + GET SUBGRAPH WITH PROP 10000000000000 STEPS FROM hash('Yao Ming') IN teammate OUT serve YIELD VERTICES as nodes, EDGES as relationships + """ + Then the result should be, in any order, with relax comparison: + | nodes | relationships | + | [("Yao Ming")] | [[:serve "Yao Ming"->"Rockets"@0]] | + | [("Rockets")] | [] | + When executing query: + """ + GET SUBGRAPH 10000000000000 STEPS FROM hash('Yao Ming') IN teammate OUT serve YIELD vertices as nodes, edges as relationships + """ + Then the result should be, in any order, with relax comparison: + | nodes | relationships | + | [("Yao Ming")] | [[:serve "Yao Ming"->"Rockets"@0]] | + | [("Rockets")] | [] | + + Scenario: yield Integer Vid many steps without prop + When executing query: + """ + GET SUBGRAPH 4 STEPS FROM hash('Yao Ming') IN teammate OUT serve YIELD VERTICES as nodes, EDGES as relationships + """ + Then the result should be, in any order, with relax comparison: + | nodes | relationships | + | [("Yao Ming")] | [[:serve "Yao Ming"->"Rockets"@0]] | + | [("Rockets")] | [] | + When executing query: + """ + GET SUBGRAPH 4 STEPS FROM hash('NOBODY') IN teammate OUT serve YIELD VERTICES as nodes, EDGES as relationships + """ + Then the result should be, in any order, with relax comparison: + | nodes | relationships | + | [("NOBODY")] | [] | + When executing query: + """ + GET SUBGRAPH 4 steps from hash('Yao Ming') IN teammate OUT serve BOTH like YIELD VERTICES as nodes, EDGES as relationships + """ + Then define some list variables: + | edge1 | vertex2 | edge2 | vertex3 | edge3 | vertex4 | edge4 | vertex5 | edge5 | + | [:serve "Yao Ming"->"Rockets"@0] | ("Shaquile O'Neal") | [:serve "Shaquile O'Neal"->"Cavaliers"@0] | ("Kobe Bryant") | [:serve "Kobe Bryant"->"Lakers"@0] | ("Manu Ginobili") | [:serve "Manu Ginobili"->"Spurs"@0] | ("Dirk Nowitzki") | [:like "Dirk Nowitzki"->"Steve Nash"@0] | + | [:like "Yao Ming"->"Shaquile O'Neal"@0] | ("Tracy McGrady") | [:serve "Shaquile O'Neal"->"Celtics"@0] | ("Grant Hill") | [:like "Paul Gasol"->"Kobe Bryant"@0] | ("Paul Gasol") | [:teammate "Tim Duncan"->"Manu Ginobili"@0] | ("Kevin Durant") | [:serve "Kevin Durant"->"Warriors"@0] | + | [:like "Yao Ming"->"Tracy McGrady"@0] | ("Rockets") | [:serve "Shaquile O'Neal"->"Heat"@0] | ("Vince Carter") | [:serve "Grant Hill"->"Clippers"@0] | ("Jason Kidd") | [:teammate "Tony Parker"->"Manu Ginobili"@0] | ("Damian Lillard") | [:serve "Damian Lillard"->"Trail Blazers"@0] | + | | | [:serve "Shaquile O'Neal"->"Lakers"@0] | ("Tim Duncan") | [:serve "Grant Hill"->"Magic"@0] | ("Tony Parker") | [:like "Dejounte Murray"->"Manu Ginobili"@0] | ("James Harden") | [:serve "James Harden"->"Rockets"@0] | + | | | [:serve "Shaquile O'Neal"->"Magic"@0] | ("JaVale McGee") | [:serve "Grant Hill"->"Pistons"@0] | ("Marco Belinelli") | [:like "Tiago Splitter"->"Manu Ginobili"@0] | ("Chris Paul") | [:like "Steve Nash"->"Dirk Nowitzki"@0] | + | | | [:serve "Shaquile O'Neal"->"Suns"@0] | ("Rudy Gay") | [:serve "Grant Hill"->"Suns"@0] | ("Dejounte Murray") | [:like "Tony Parker"->"Manu Ginobili"@0] | ("LeBron James") | [:like "Russell Westbrook"->"James Harden"@0] | + | | | [:like "Shaquile O'Neal"->"JaVale McGee"@0] | ("Magic") | [:serve "Vince Carter"->"Grizzlies"@0] | ("Aron Baynes") | [:serve "Paul Gasol"->"Bucks"@0] | ("Steve Nash") | [:like "James Harden"->"Russell Westbrook"@0] | + | | | [:like "Shaquile O'Neal"->"Tim Duncan"@0] | ("Spurs") | [:serve "Vince Carter"->"Hawks"@0] | ("Boris Diaw") | [:serve "Paul Gasol"->"Bulls"@0] | ("Marc Gasol") | [:serve "Chris Paul"->"Clippers"@0] | + | | | [:serve "Tracy McGrady"->"Magic"@0] | ("Celtics") | [:serve "Vince Carter"->"Kings"@0] | ("Danny Green") | [:serve "Paul Gasol"->"Grizzlies"@0] | ("Kyle Anderson") | [:serve "Chris Paul"->"Hornets"@0] | + | | | [:serve "Tracy McGrady"->"Raptors"@0] | ("Heat") | [:serve "Vince Carter"->"Magic"@0] | ("LaMarcus Aldridge") | [:serve "Paul Gasol"->"Lakers"@0] | ("Russell Westbrook") | [:serve "Chris Paul"->"Rockets"@0] | + | | | [:serve "Tracy McGrady"->"Rockets"@0] | ("Suns") | [:serve "Vince Carter"->"Mavericks"@0] | ("Tiago Splitter") | [:serve "Paul Gasol"->"Spurs"@0] | ("76ers") | [:serve "Dirk Nowitzki"->"Mavericks"@0] | + | | | [:serve "Tracy McGrady"->"Spurs"@0] | ("Lakers") | [:serve "Vince Carter"->"Nets"@0] | ("Pistons") | [:like "Marc Gasol"->"Paul Gasol"@0] | ("Hornets") | [:like "Chris Paul"->"LeBron James"@0] | + | | | [:like "Grant Hill"->"Tracy McGrady"@0] | ("Cavaliers") | [:serve "Vince Carter"->"Raptors"@0] | ("Nets") | [:like "Paul Gasol"->"Marc Gasol"@0] | ("Bucks") | [:serve "Steve Nash"->"Lakers"@0] | + | | | [:like "Vince Carter"->"Tracy McGrady"@0] | ("Raptors") | [:serve "Vince Carter"->"Suns"@0] | ("Kings") | [:serve "Jason Kidd"->"Knicks"@0] | ("Knicks") | [:serve "Steve Nash"->"Mavericks"@0] | + | | | [:like "Tracy McGrady"->"Grant Hill"@0] | | [:like "Jason Kidd"->"Vince Carter"@0] | ("Clippers") | [:serve "Jason Kidd"->"Mavericks"@0] | ("Bulls") | [:serve "Steve Nash"->"Suns"@0] | + | | | [:like "Tracy McGrady"->"Kobe Bryant"@0] | | [:like "Vince Carter"->"Jason Kidd"@0] | ("Mavericks") | [:serve "Jason Kidd"->"Nets"@0] | ("Trail Blazers") | [:serve "Steve Nash"->"Suns"@1] | + | | | [:like "Tracy McGrady"->"Rudy Gay"@0] | | [:serve "Tim Duncan"->"Spurs"@0] | ("Hawks") | [:serve "Jason Kidd"->"Suns"@0] | ("Jazz") | [:serve "LeBron James"->"Cavaliers"@1] | + | | | | | [:teammate "Manu Ginobili"->"Tim Duncan"@0] | ("Warriors") | [:serve "Jason Kidd"->"Mavericks"@1] | | [:serve "LeBron James"->"Lakers"@0] | + | | | | | [:teammate "Tony Parker"->"Tim Duncan"@0] | ("Nuggets") | [:like "Dirk Nowitzki"->"Jason Kidd"@0] | | [:serve "LeBron James"->"Heat"@0] | + | | | | | [:like "Aron Baynes"->"Tim Duncan"@0] | ("Grizzlies") | [:like "Steve Nash"->"Jason Kidd"@0] | | [:serve "Marc Gasol"->"Grizzlies"@0] | + | | | | | [:like "Boris Diaw"->"Tim Duncan"@0] | ("Wizards") | [:like "Jason Kidd"->"Dirk Nowitzki"@0] | | [:serve "Marc Gasol"->"Raptors"@0] | + | | | | | [:like "Danny Green"->"Tim Duncan"@0] | | [:like "Jason Kidd"->"Steve Nash"@0] | | [:serve "Kyle Anderson"->"Grizzlies"@0] | + | | | | | [:like "Dejounte Murray"->"Tim Duncan"@0] | | [:serve "Tony Parker"->"Hornets"@0] | | [:serve "Kyle Anderson"->"Spurs"@0] | + | | | | | [:like "LaMarcus Aldridge"->"Tim Duncan"@0] | | [:serve "Tony Parker"->"Spurs"@0] | | [:teammate "Tony Parker"->"Kyle Anderson"@0] | + | | | | | [:like "Manu Ginobili"->"Tim Duncan"@0] | | [:teammate "Manu Ginobili"->"Tony Parker"@0] | | [:serve "LeBron James"->"Cavaliers"@0] | + | | | | | [:like "Marco Belinelli"->"Tim Duncan"@0] | | [:teammate "Tim Duncan"->"Tony Parker"@0] | | | + | | | | | [:like "Tiago Splitter"->"Tim Duncan"@0] | | [:like "Boris Diaw"->"Tony Parker"@0] | | | + | | | | | [:like "Tony Parker"->"Tim Duncan"@0] | | [:like "Dejounte Murray"->"Tony Parker"@0] | | | + | | | | | [:like "Tim Duncan"->"Manu Ginobili"@0] | | [:like "LaMarcus Aldridge"->"Tony Parker"@0] | | | + | | | | | [:like "Tim Duncan"->"Tony Parker"@0] | | [:like "Marco Belinelli"->"Tony Parker"@0] | | | + | | | | | [:serve "JaVale McGee"->"Lakers"@0] | | [:like "Tony Parker"->"LaMarcus Aldridge"@0] | | | + | | | | | [:serve "JaVale McGee"->"Mavericks"@0] | | [:serve "Marco Belinelli"->"76ers"@0] | | | + | | | | | [:serve "JaVale McGee"->"Nuggets"@0] | | [:serve "Marco Belinelli"->"Bulls"@0] | | | + | | | | | [:serve "JaVale McGee"->"Warriors"@0] | | [:serve "Marco Belinelli"->"Hawks"@0] | | | + | | | | | [:serve "JaVale McGee"->"Wizards"@0] | | [:serve "Marco Belinelli"->"Hornets"@0] | | | + | | | | | [:serve "Rudy Gay"->"Grizzlies"@0] | | [:serve "Marco Belinelli"->"Kings"@0] | | | + | | | | | [:serve "Rudy Gay"->"Kings"@0] | | [:serve "Marco Belinelli"->"Raptors"@0] | | | + | | | | | [:serve "Rudy Gay"->"Raptors"@0] | | [:serve "Marco Belinelli"->"Spurs"@0] | | | + | | | | | [:serve "Rudy Gay"->"Spurs"@0] | | [:serve "Marco Belinelli"->"Warriors"@0] | | | + | | | | | [:like "Rudy Gay"->"LaMarcus Aldridge"@0] | | [:serve "Marco Belinelli"->"Hornets"@1] | | | + | | | | | | | [:serve "Marco Belinelli"->"Spurs"@1] | | | + | | | | | | | [:like "Danny Green"->"Marco Belinelli"@0] | | | + | | | | | | | [:like "Dejounte Murray"->"Marco Belinelli"@0] | | | + | | | | | | | [:like "Marco Belinelli"->"Danny Green"@0] | | | + | | | | | | | [:serve "Dejounte Murray"->"Spurs"@0] | | | + | | | | | | | [:like "Dejounte Murray"->"Chris Paul"@0] | | | + | | | | | | | [:like "Dejounte Murray"->"Danny Green"@0] | | | + | | | | | | | [:like "Dejounte Murray"->"James Harden"@0] | | | + | | | | | | | [:like "Dejounte Murray"->"Kevin Durant"@0] | | | + | | | | | | | [:like "Dejounte Murray"->"Kyle Anderson"@0] | | | + | | | | | | | [:like "Dejounte Murray"->"LeBron James"@0] | | | + | | | | | | | [:like "Dejounte Murray"->"Russell Westbrook"@0] | | | + | | | | | | | [:serve "Aron Baynes"->"Celtics"@0] | | | + | | | | | | | [:serve "Aron Baynes"->"Pistons"@0] | | | + | | | | | | | [:serve "Aron Baynes"->"Spurs"@0] | | | + | | | | | | | [:serve "Boris Diaw"->"Hawks"@0] | | | + | | | | | | | [:serve "Boris Diaw"->"Hornets"@0] | | | + | | | | | | | [:serve "Boris Diaw"->"Jazz"@0] | | | + | | | | | | | [:serve "Boris Diaw"->"Spurs"@0] | | | + | | | | | | | [:serve "Boris Diaw"->"Suns"@0] | | | + | | | | | | | [:serve "Danny Green"->"Cavaliers"@0] | | | + | | | | | | | [:serve "Danny Green"->"Raptors"@0] | | | + | | | | | | | [:serve "Danny Green"->"Spurs"@0] | | | + | | | | | | | [:teammate "Tim Duncan"->"Danny Green"@0] | | | + | | | | | | | [:like "Danny Green"->"LeBron James"@0] | | | + | | | | | | | [:serve "LaMarcus Aldridge"->"Spurs"@0] | | | + | | | | | | | [:serve "LaMarcus Aldridge"->"Trail Blazers"@0] | | | + | | | | | | | [:teammate "Tim Duncan"->"LaMarcus Aldridge"@0] | | | + | | | | | | | [:teammate "Tony Parker"->"LaMarcus Aldridge"@0] | | | + | | | | | | | [:like "Damian Lillard"->"LaMarcus Aldridge"@0] | | | + | | | | | | | [:serve "Tiago Splitter"->"76ers"@0] | | | + | | | | | | | [:serve "Tiago Splitter"->"Hawks"@0] | | | + | | | | | | | [:serve "Tiago Splitter"->"Spurs"@0] | | | + Then the result should be, in any order, with relax comparison: + | nodes | relationships | + | [("Yao Ming")] | <[edge1]> | + | <[vertex2]> | <[edge2]> | + | <[vertex3]> | <[edge3]> | + | <[vertex4]> | <[edge4]> | + | <[vertex5]> | <[edge5]> | + When executing query: + """ + GET SUBGRAPH 5 steps from hash('Tony Parker') IN teammate OUT serve BOTH like YIELD VERTICES as nodes, EDGES as relationships + """ + Then define some list variables: + | edge1 | vertex2 | edge2 | vertex3 | edge3 | vertex4 | edge4 | vertex5 | edge5 | vertex6 | edge6 | + | [:serve "Tony Parker"->"Hornets"@0] | ("Tim Duncan") | [:serve "Tim Duncan"->"Spurs"@0] | ("Aron Baynes") | [:serve "Aron Baynes"->"Celtics"@0] | ("Yao Ming") | [:serve "Yao Ming"->"Rockets"@0] | ("Grant Hill") | [:serve "Grant Hill"->"Clippers"@0] | ("Steve Nash") | [:serve "Steve Nash"->"Lakers"@0] | + | [:serve "Tony Parker"->"Spurs"@0] | ("Boris Diaw") | [:teammate "Manu Ginobili"->"Tim Duncan"@0] | ("Rudy Gay") | [:serve "Aron Baynes"->"Pistons"@0] | ("Ray Allen") | [:like "Yao Ming"->"Tracy McGrady"@0] | ("Kristaps Porzingis") | [:serve "Grant Hill"->"Magic"@0] | ("Paul Gasol") | [:serve "Steve Nash"->"Mavericks"@0] | + | [:teammate "Manu Ginobili"->"Tony Parker"@0] | ("LaMarcus Aldridge") | [:teammate "Tony Parker"->"Tim Duncan"@0] | ("Damian Lillard") | [:serve "Aron Baynes"->"Spurs"@0] | ("Blake Griffin") | [:serve "Ray Allen"->"Bucks"@0] | ("Dirk Nowitzki") | [:serve "Grant Hill"->"Pistons"@0] | ("Jason Kidd") | [:serve "Steve Nash"->"Suns"@0] | + | [:teammate "Tim Duncan"->"Tony Parker"@0] | ("Manu Ginobili") | [:like "Aron Baynes"->"Tim Duncan"@0] | ("Kevin Durant") | [:serve "Rudy Gay"->"Grizzlies"@0] | ("Paul George") | [:serve "Ray Allen"->"Celtics"@0] | ("Rajon Rondo") | [:serve "Grant Hill"->"Suns"@0] | ("Pelicans") | [:serve "Steve Nash"->"Suns"@1] | + | [:like "Boris Diaw"->"Tony Parker"@0] | ("Marco Belinelli") | [:like "Boris Diaw"->"Tim Duncan"@0] | ("Shaquile O'Neal") | [:serve "Rudy Gay"->"Kings"@0] | ("JaVale McGee") | [:serve "Ray Allen"->"Heat"@0] | ("Vince Carter") | [:serve "Kristaps Porzingis"->"Knicks"@0] | ("Nets") | [:like "Jason Kidd"->"Steve Nash"@0] | + | [:like "Dejounte Murray"->"Tony Parker"@0] | ("Dejounte Murray") | [:like "Danny Green"->"Tim Duncan"@0] | ("Tiago Splitter") | [:serve "Rudy Gay"->"Raptors"@0] | ("Luka Doncic") | [:serve "Ray Allen"->"Thunders"@0] | ("Kobe Bryant") | [:serve "Kristaps Porzingis"->"Mavericks"@0] | | [:serve "Paul Gasol"->"Spurs"@0] | + | [:like "LaMarcus Aldridge"->"Tony Parker"@0] | ("Hornets") | [:like "Dejounte Murray"->"Tim Duncan"@0] | ("Russell Westbrook") | [:serve "Rudy Gay"->"Spurs"@0] | ("Carmelo Anthony") | [:like "Rajon Rondo"->"Ray Allen"@0] | ("Wizards") | [:serve "Dirk Nowitzki"->"Mavericks"@0] | | [:like "Steve Nash"->"Jason Kidd"@0] | + | [:like "Marco Belinelli"->"Tony Parker"@0] | ("Spurs") | [:like "LaMarcus Aldridge"->"Tim Duncan"@0] | ("Danny Green") | [:like "Tracy McGrady"->"Rudy Gay"@0] | ("Tracy McGrady") | [:like "Ray Allen"->"Rajon Rondo"@0] | ("Pacers") | [:like "Jason Kidd"->"Dirk Nowitzki"@0] | | [:serve "Paul Gasol"->"Lakers"@0] | + | [:like "Tim Duncan"->"Tony Parker"@0] | | [:like "Manu Ginobili"->"Tim Duncan"@0] | ("Kyle Anderson") | [:serve "Damian Lillard"->"Trail Blazers"@0] | ("Dwyane Wade") | [:serve "Blake Griffin"->"Clippers"@0] | ("Knicks") | [:like "Steve Nash"->"Dirk Nowitzki"@0] | | [:serve "Jason Kidd"->"Knicks"@0] | + | [:like "Tony Parker"->"LaMarcus Aldridge"@0] | | [:like "Marco Belinelli"->"Tim Duncan"@0] | ("James Harden") | [:serve "Kevin Durant"->"Thunders"@0] | ("Kyrie Irving") | [:serve "Blake Griffin"->"Pistons"@0] | ("Bucks") | [:like "Dirk Nowitzki"->"Jason Kidd"@0] | | [:serve "Jason Kidd"->"Mavericks"@0] | + | [:like "Tony Parker"->"Manu Ginobili"@0] | | [:like "Shaquile O'Neal"->"Tim Duncan"@0] | ("LeBron James") | [:serve "Kevin Durant"->"Warriors"@0] | ("Cavaliers") | [:serve "Paul George"->"Pacers"@0] | ("Mavericks") | [:like "Dirk Nowitzki"->"Steve Nash"@0] | | [:serve "Jason Kidd"->"Nets"@0] | + | [:like "Tony Parker"->"Tim Duncan"@0] | | [:like "Tiago Splitter"->"Tim Duncan"@0] | ("Chris Paul") | [:serve "Shaquile O'Neal"->"Cavaliers"@0] | ("Celtics") | [:serve "Paul George"->"Thunders"@0] | ("Nuggets") | [:serve "Rajon Rondo"->"Bulls"@0] | | [:serve "Jason Kidd"->"Suns"@0] | + | | | [:like "Tim Duncan"->"Manu Ginobili"@0] | ("Bulls") | [:serve "Shaquile O'Neal"->"Celtics"@0] | ("Pistons") | [:serve "JaVale McGee"->"Lakers"@0] | | [:serve "Rajon Rondo"->"Celtics"@0] | | [:serve "Jason Kidd"->"Mavericks"@1] | + | | | [:serve "Boris Diaw"->"Hawks"@0] | ("Jazz") | [:serve "Shaquile O'Neal"->"Heat"@0] | ("Grizzlies") | [:serve "JaVale McGee"->"Mavericks"@0] | | [:serve "Rajon Rondo"->"Kings"@0] | | [:serve "Paul Gasol"->"Bucks"@0] | + | | | [:serve "Boris Diaw"->"Hornets"@0] | ("Hawks") | [:serve "Shaquile O'Neal"->"Lakers"@0] | ("Heat") | [:serve "JaVale McGee"->"Nuggets"@0] | | [:serve "Rajon Rondo"->"Lakers"@0] | | [:serve "Paul Gasol"->"Bulls"@0] | + | | | [:serve "Boris Diaw"->"Jazz"@0] | ("Warriors") | [:serve "Shaquile O'Neal"->"Magic"@0] | ("Magic") | [:serve "JaVale McGee"->"Warriors"@0] | | [:serve "Rajon Rondo"->"Mavericks"@0] | | [:serve "Paul Gasol"->"Grizzlies"@0] | + | | | [:serve "Boris Diaw"->"Spurs"@0] | ("Suns") | [:serve "Shaquile O'Neal"->"Suns"@0] | ("Lakers") | [:serve "JaVale McGee"->"Wizards"@0] | | [:serve "Rajon Rondo"->"Pelicans"@0] | | | + | | | [:serve "Boris Diaw"->"Suns"@0] | ("Trail Blazers") | [:like "Yao Ming"->"Shaquile O'Neal"@0] | ("Clippers") | [:serve "Luka Doncic"->"Mavericks"@0] | | [:serve "Vince Carter"->"Grizzlies"@0] | | | + | | | [:serve "LaMarcus Aldridge"->"Spurs"@0] | ("Kings") | [:like "Shaquile O'Neal"->"JaVale McGee"@0] | ("Thunders") | [:like "Kristaps Porzingis"->"Luka Doncic"@0] | | [:serve "Vince Carter"->"Hawks"@0] | | | + | | | [:serve "LaMarcus Aldridge"->"Trail Blazers"@0] | ("Raptors") | [:serve "Tiago Splitter"->"76ers"@0] | ("Rockets") | [:like "Luka Doncic"->"Dirk Nowitzki"@0] | | [:serve "Vince Carter"->"Kings"@0] | | | + | | | [:teammate "Tim Duncan"->"LaMarcus Aldridge"@0] | ("76ers") | [:serve "Tiago Splitter"->"Hawks"@0] | | [:like "Luka Doncic"->"Kristaps Porzingis"@0] | | [:serve "Vince Carter"->"Magic"@0] | | | + | | | [:teammate "Tony Parker"->"LaMarcus Aldridge"@0] | | [:serve "Tiago Splitter"->"Spurs"@0] | | [:serve "Carmelo Anthony"->"Knicks"@0] | | [:serve "Vince Carter"->"Mavericks"@0] | | | + | | | [:like "Damian Lillard"->"LaMarcus Aldridge"@0] | | [:serve "Russell Westbrook"->"Thunders"@0] | | [:serve "Carmelo Anthony"->"Nuggets"@0] | | [:serve "Vince Carter"->"Nets"@0] | | | + | | | [:like "Rudy Gay"->"LaMarcus Aldridge"@0] | | [:like "James Harden"->"Russell Westbrook"@0] | | [:serve "Carmelo Anthony"->"Rockets"@0] | | [:serve "Vince Carter"->"Raptors"@0] | | | + | | | [:serve "Manu Ginobili"->"Spurs"@0] | | [:like "Paul George"->"Russell Westbrook"@0] | | [:serve "Carmelo Anthony"->"Thunders"@0] | | [:serve "Vince Carter"->"Suns"@0] | | | + | | | [:teammate "Tim Duncan"->"Manu Ginobili"@0] | | [:like "Russell Westbrook"->"James Harden"@0] | | [:like "Dwyane Wade"->"Carmelo Anthony"@0] | | [:like "Jason Kidd"->"Vince Carter"@0] | | | + | | | [:teammate "Tony Parker"->"Manu Ginobili"@0] | | [:like "Russell Westbrook"->"Paul George"@0] | | [:like "Carmelo Anthony"->"Dwyane Wade"@0] | | [:like "Vince Carter"->"Jason Kidd"@0] | | | + | | | [:like "Dejounte Murray"->"Manu Ginobili"@0] | | [:serve "Danny Green"->"Cavaliers"@0] | | [:serve "Tracy McGrady"->"Magic"@0] | | [:serve "Kobe Bryant"->"Lakers"@0] | | | + | | | [:like "Tiago Splitter"->"Manu Ginobili"@0] | | [:serve "Danny Green"->"Raptors"@0] | | [:serve "Tracy McGrady"->"Raptors"@0] | | [:like "Paul Gasol"->"Kobe Bryant"@0] | | | + | | | [:serve "Marco Belinelli"->"76ers"@0] | | [:serve "Danny Green"->"Spurs"@0] | | [:serve "Tracy McGrady"->"Rockets"@0] | | | | | + | | | [:serve "Marco Belinelli"->"Bulls"@0] | | [:teammate "Tim Duncan"->"Danny Green"@0] | | [:serve "Tracy McGrady"->"Spurs"@0] | | | | | + | | | [:serve "Marco Belinelli"->"Hawks"@0] | | [:like "Danny Green"->"LeBron James"@0] | | [:like "Grant Hill"->"Tracy McGrady"@0] | | | | | + | | | [:serve "Marco Belinelli"->"Hornets"@0] | | [:serve "Kyle Anderson"->"Grizzlies"@0] | | [:like "Vince Carter"->"Tracy McGrady"@0] | | | | | + | | | [:serve "Marco Belinelli"->"Kings"@0] | | [:serve "Kyle Anderson"->"Spurs"@0] | | [:like "Tracy McGrady"->"Grant Hill"@0] | | | | | + | | | [:serve "Marco Belinelli"->"Raptors"@0] | | [:teammate "Tony Parker"->"Kyle Anderson"@0] | | [:like "Tracy McGrady"->"Kobe Bryant"@0] | | | | | + | | | [:serve "Marco Belinelli"->"Spurs"@0] | | [:serve "James Harden"->"Rockets"@0] | | [:serve "Dwyane Wade"->"Bulls"@0] | | | | | + | | | [:serve "Marco Belinelli"->"Warriors"@0] | | [:serve "James Harden"->"Thunders"@0] | | [:serve "Dwyane Wade"->"Cavaliers"@0] | | | | | + | | | [:serve "Marco Belinelli"->"Hornets"@1] | | [:like "Luka Doncic"->"James Harden"@0] | | [:serve "Dwyane Wade"->"Heat"@0] | | | | | + | | | [:serve "Marco Belinelli"->"Spurs"@1] | | [:serve "LeBron James"->"Cavaliers"@0] | | [:serve "Dwyane Wade"->"Heat"@1] | | | | | + | | | [:like "Danny Green"->"Marco Belinelli"@0] | | [:serve "LeBron James"->"Heat"@0] | | [:like "Dirk Nowitzki"->"Dwyane Wade"@0] | | | | | + | | | [:like "Dejounte Murray"->"Marco Belinelli"@0] | | [:serve "LeBron James"->"Lakers"@0] | | [:serve "Kyrie Irving"->"Cavaliers"@0] | | | | | + | | | [:like "Marco Belinelli"->"Danny Green"@0] | | [:serve "LeBron James"->"Cavaliers"@1] | | [:serve "Kyrie Irving"->"Celtics"@0] | | | | | + | | | [:serve "Dejounte Murray"->"Spurs"@0] | | [:like "Carmelo Anthony"->"LeBron James"@0] | | | | | | | + | | | [:like "Dejounte Murray"->"Chris Paul"@0] | | [:like "Chris Paul"->"LeBron James"@0] | | | | | | | + | | | [:like "Dejounte Murray"->"Danny Green"@0] | | [:like "Dwyane Wade"->"LeBron James"@0] | | | | | | | + | | | [:like "Dejounte Murray"->"James Harden"@0] | | [:like "Kyrie Irving"->"LeBron James"@0] | | | | | | | + | | | [:like "Dejounte Murray"->"Kevin Durant"@0] | | [:like "LeBron James"->"Ray Allen"@0] | | | | | | | + | | | [:like "Dejounte Murray"->"Kyle Anderson"@0] | | [:serve "Chris Paul"->"Clippers"@0] | | | | | | | + | | | [:like "Dejounte Murray"->"LeBron James"@0] | | [:serve "Chris Paul"->"Hornets"@0] | | | | | | | + | | | [:like "Dejounte Murray"->"Russell Westbrook"@0] | | [:serve "Chris Paul"->"Rockets"@0] | | | | | | | + | | | | | [:like "Blake Griffin"->"Chris Paul"@0] | | | | | | | + | | | | | [:like "Carmelo Anthony"->"Chris Paul"@0] | | | | | | | + | | | | | [:like "Dwyane Wade"->"Chris Paul"@0] | | | | | | | + | | | | | [:like "Chris Paul"->"Carmelo Anthony"@0] | | | | | | | + | | | | | [:like "Chris Paul"->"Dwyane Wade"@0] | | | | | | | + Then the result should be, in any order, with relax comparison: + | nodes | relationships | + | [("Tony Parker")] | <[edge1]> | + | <[vertex2]> | <[edge2]> | + | <[vertex3]> | <[edge3]> | + | <[vertex4]> | <[edge4]> | + | <[vertex5]> | <[edge5]> | + | <[vertex6]> | <[edge6]> | + When executing query: + """ + GET SUBGRAPH 4 steps from hash('Tim Duncan') BOTH like YIELD VERTICES as nodes, EDGES as relationships + """ + Then define some list variables: + | edge1 | vertex2 | edge2 | vertex3 | edge3 | vertex4 | edge4 | vertex5 | + | [:like "Aron Baynes"->"Tim Duncan"@0] | ("LaMarcus Aldridge") | [:like "Damian Lillard"->"LaMarcus Aldridge"@0] | ("Kevin Durant") | [:like "Luka Doncic"->"James Harden"@0] | ("Tracy McGrady") | [:like "Grant Hill"->"Tracy McGrady"@0] | ("Kobe Bryant") | + | [:like "Boris Diaw"->"Tim Duncan"@0] | ("Boris Diaw") | [:like "Rudy Gay"->"LaMarcus Aldridge"@0] | ("James Harden") | [:like "Russell Westbrook"->"James Harden"@0] | ("Carmelo Anthony") | [:like "Vince Carter"->"Tracy McGrady"@0] | ("Dirk Nowitzki") | + | [:like "Danny Green"->"Tim Duncan"@0] | ("Dejounte Murray") | [:like "Tony Parker"->"LaMarcus Aldridge"@0] | ("Chris Paul") | [:like "James Harden"->"Russell Westbrook"@0] | ("Luka Doncic") | [:like "Tracy McGrady"->"Grant Hill"@0] | ("Grant Hill") | + | [:like "Dejounte Murray"->"Tim Duncan"@0] | ("Danny Green") | [:like "LaMarcus Aldridge"->"Tony Parker"@0] | ("Damian Lillard") | [:like "Blake Griffin"->"Chris Paul"@0] | ("Blake Griffin") | [:like "Tracy McGrady"->"Kobe Bryant"@0] | ("Vince Carter") | + | [:like "LaMarcus Aldridge"->"Tim Duncan"@0] | ("Marco Belinelli") | [:like "Boris Diaw"->"Tony Parker"@0] | ("Rudy Gay") | [:like "Carmelo Anthony"->"Chris Paul"@0] | ("Dwyane Wade") | [:like "Dwyane Wade"->"Carmelo Anthony"@0] | ("Rajon Rondo") | + | [:like "Manu Ginobili"->"Tim Duncan"@0] | ("Aron Baynes") | [:like "Dejounte Murray"->"Chris Paul"@0] | ("Kyle Anderson") | [:like "Dwyane Wade"->"Chris Paul"@0] | ("Kyrie Irving") | [:like "Carmelo Anthony"->"Dwyane Wade"@0] | ("Kristaps Porzingis") | + | [:like "Marco Belinelli"->"Tim Duncan"@0] | ("Manu Ginobili") | [:like "Dejounte Murray"->"Danny Green"@0] | ("LeBron James") | [:like "Chris Paul"->"Carmelo Anthony"@0] | ("Ray Allen") | [:like "Kristaps Porzingis"->"Luka Doncic"@0] | | + | [:like "Shaquile O'Neal"->"Tim Duncan"@0] | ("Tiago Splitter") | [:like "Dejounte Murray"->"James Harden"@0] | ("Russell Westbrook") | [:like "Chris Paul"->"Dwyane Wade"@0] | ("Paul George") | [:like "Luka Doncic"->"Dirk Nowitzki"@0] | | + | [:like "Tiago Splitter"->"Tim Duncan"@0] | ("Shaquile O'Neal") | [:like "Dejounte Murray"->"Kevin Durant"@0] | ("Yao Ming") | [:like "Chris Paul"->"LeBron James"@0] | | [:like "Luka Doncic"->"Kristaps Porzingis"@0] | | + | [:like "Tony Parker"->"Tim Duncan"@0] | ("Tony Parker") | [:like "Dejounte Murray"->"Kyle Anderson"@0] | ("JaVale McGee") | [:like "Tracy McGrady"->"Rudy Gay"@0] | | [:like "Dirk Nowitzki"->"Dwyane Wade"@0] | | + | [:like "Tim Duncan"->"Manu Ginobili"@0] | | [:like "Dejounte Murray"->"LeBron James"@0] | | [:like "Carmelo Anthony"->"LeBron James"@0] | | [:like "Rajon Rondo"->"Ray Allen"@0] | | + | [:like "Tim Duncan"->"Tony Parker"@0] | | [:like "Dejounte Murray"->"Manu Ginobili"@0] | | [:like "Dwyane Wade"->"LeBron James"@0] | | [:like "Ray Allen"->"Rajon Rondo"@0] | | + | | | [:like "Dejounte Murray"->"Marco Belinelli"@0] | | [:like "Kyrie Irving"->"LeBron James"@0] | | | | + | | | [:like "Dejounte Murray"->"Russell Westbrook"@0] | | [:like "LeBron James"->"Ray Allen"@0] | | | | + | | | [:like "Dejounte Murray"->"Tony Parker"@0] | | [:like "Paul George"->"Russell Westbrook"@0] | | | | + | | | [:like "Marco Belinelli"->"Danny Green"@0] | | [:like "Russell Westbrook"->"Paul George"@0] | | | | + | | | [:like "Danny Green"->"LeBron James"@0] | | [:like "Yao Ming"->"Tracy McGrady"@0] | | | | + | | | [:like "Danny Green"->"Marco Belinelli"@0] | | | | | | + | | | [:like "Marco Belinelli"->"Tony Parker"@0] | | | | | | + | | | [:like "Tiago Splitter"->"Manu Ginobili"@0] | | | | | | + | | | [:like "Tony Parker"->"Manu Ginobili"@0] | | | | | | + | | | [: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: + | nodes | relationships | + | [("Tim Duncan")] | <[edge1]> | + | <[vertex2]> | <[edge2]> | + | <[vertex3]> | <[edge3]> | + | <[vertex4]> | <[edge4]> | + | <[vertex5]> | [] | + + 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 VERTICES as nodes + """ + Then define some list variables: + | vertex1 | vertex2 | + | ("Tim Duncan") | ("Manu Ginobili") | + | ("James Harden") | ("Tony Parker") | + | | ("Spurs") | + | | ("Rockets") | + | | ("Thunders") | + | | | + | | | + Then the result should be, in any order, with relax comparison: + | nodes | + | <[vertex1]> | + | <[vertex2]> | + | [("Hornets")] | + When executing query: + """ + GET SUBGRAPH WITH PROP 2 STEPS FROM hash('Tim Duncan') IN like, serve YIELD EDGES as relationships + """ + Then define some list variables: + | edge1 | edge2 | + | [:like "Aron Baynes"->"Tim Duncan"@0] | [:like "Damian Lillard"->"LaMarcus Aldridge"@0] | + | [:like "Boris Diaw"->"Tim Duncan"@0] | [:like "Rudy Gay"->"LaMarcus Aldridge"@0] | + | [:like "Danny Green"->"Tim Duncan"@0] | [:like "Tony Parker"->"LaMarcus Aldridge"@0] | + | [:like "Dejounte Murray"->"Tim Duncan"@0] | [:like "Dejounte Murray"->"Danny Green"@0] | + | [:like "LaMarcus Aldridge"->"Tim Duncan"@0] | [:like "Marco Belinelli"->"Danny Green"@0] | + | [:like "Manu Ginobili"->"Tim Duncan"@0] | [:like "Danny Green"->"Marco Belinelli"@0] | + | [:like "Marco Belinelli"->"Tim Duncan"@0] | [:like "Dejounte Murray"->"Marco Belinelli"@0] | + | [:like "Shaquile O'Neal"->"Tim Duncan"@0] | [:like "Dejounte Murray"->"Manu Ginobili"@0] | + | [:like "Tiago Splitter"->"Tim Duncan"@0] | [:like "Tiago Splitter"->"Manu Ginobili"@0] | + | [:like "Tony Parker"->"Tim Duncan"@0] | [:like "Tim Duncan"->"Manu Ginobili"@0] | + | | [:like "Tony Parker"->"Manu Ginobili"@0] | + | | [:like "Yao Ming"->"Shaquile O'Neal"@0] | + | | [:like "Boris Diaw"->"Tony Parker"@0] | + | | [:like "Dejounte Murray"->"Tony Parker"@0] | + | | [:like "LaMarcus Aldridge"->"Tony Parker"@0] | + | | [:like "Marco Belinelli"->"Tony Parker"@0] | + | | [:like "Tim Duncan"->"Tony Parker"@0] | + Then the result should be, in any order, with relax comparison: + | relationships | + | <[edge1]> | + | <[edge2]> | + | [] | + When executing query: + """ + GET SUBGRAPH WITH PROP FROM hash('Tony Parker') BOTH like YIELD edges as relationships, vertices as nodes + """ + Then define some list variables: + | edge1 | vertex2 | edge2 | + | [:like "Boris Diaw"->"Tony Parker"@0] | ("Manu Ginobili") | [:like "Manu Ginobili"->"Tim Duncan"@0] | + | [:like "Dejounte Murray"->"Tony Parker"@0] | ("Marco Belinelli") | [:like "Dejounte Murray"->"Marco Belinelli"@0] | + | [:like "LaMarcus Aldridge"->"Tony Parker"@0] | ("Tim Duncan") | [:like "Marco Belinelli"->"Tim Duncan"@0] | + | [:like "Marco Belinelli"->"Tony Parker"@0] | ("Dejounte Murray") | [:like "Tim Duncan"->"Manu Ginobili"@0] | + | [:like "Tim Duncan"->"Tony Parker"@0] | ("LaMarcus Aldridge") | [:like "Boris Diaw"->"Tim Duncan"@0] | + | [:like "Tony Parker"->"LaMarcus Aldridge"@0] | ("Boris Diaw") | [:like "Dejounte Murray"->"Manu Ginobili"@0] | + | [: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: + | relationships | nodes | + | <[edge1]> | [("Tony Parker")] | + | <[edge2]> | <[vertex2]> | + When executing query: + """ + GET SUBGRAPH 4 steps from hash('Tim Duncan') BOTH like YIELD VERTICES as nodes, EDGES as relationships + """ + Then define some list variables: + | edge1 | vertex2 | edge2 | vertex3 | edge3 | vertex4 | edge4 | vertex5 | + | [:like "Aron Baynes"->"Tim Duncan"@0] | ("LaMarcus Aldridge") | [:like "Damian Lillard"->"LaMarcus Aldridge"@0] | ("Kevin Durant") | [:like "Luka Doncic"->"James Harden"@0] | ("Tracy McGrady") | [:like "Grant Hill"->"Tracy McGrady"@0] | ("Kobe Bryant") | + | [:like "Boris Diaw"->"Tim Duncan"@0] | ("Boris Diaw") | [:like "Rudy Gay"->"LaMarcus Aldridge"@0] | ("James Harden") | [:like "Russell Westbrook"->"James Harden"@0] | ("Carmelo Anthony") | [:like "Vince Carter"->"Tracy McGrady"@0] | ("Dirk Nowitzki") | + | [:like "Danny Green"->"Tim Duncan"@0] | ("Dejounte Murray") | [:like "Tony Parker"->"LaMarcus Aldridge"@0] | ("Chris Paul") | [:like "James Harden"->"Russell Westbrook"@0] | ("Luka Doncic") | [:like "Tracy McGrady"->"Grant Hill"@0] | ("Grant Hill") | + | [:like "Dejounte Murray"->"Tim Duncan"@0] | ("Danny Green") | [:like "LaMarcus Aldridge"->"Tony Parker"@0] | ("Damian Lillard") | [:like "Blake Griffin"->"Chris Paul"@0] | ("Blake Griffin") | [:like "Tracy McGrady"->"Kobe Bryant"@0] | ("Vince Carter") | + | [:like "LaMarcus Aldridge"->"Tim Duncan"@0] | ("Marco Belinelli") | [:like "Boris Diaw"->"Tony Parker"@0] | ("Rudy Gay") | [:like "Carmelo Anthony"->"Chris Paul"@0] | ("Dwyane Wade") | [:like "Dwyane Wade"->"Carmelo Anthony"@0] | ("Rajon Rondo") | + | [:like "Manu Ginobili"->"Tim Duncan"@0] | ("Aron Baynes") | [:like "Dejounte Murray"->"Chris Paul"@0] | ("Kyle Anderson") | [:like "Dwyane Wade"->"Chris Paul"@0] | ("Kyrie Irving") | [:like "Carmelo Anthony"->"Dwyane Wade"@0] | ("Kristaps Porzingis") | + | [:like "Marco Belinelli"->"Tim Duncan"@0] | ("Manu Ginobili") | [:like "Dejounte Murray"->"Danny Green"@0] | ("LeBron James") | [:like "Chris Paul"->"Carmelo Anthony"@0] | ("Ray Allen") | [:like "Kristaps Porzingis"->"Luka Doncic"@0] | | + | [:like "Shaquile O'Neal"->"Tim Duncan"@0] | ("Tiago Splitter") | [:like "Dejounte Murray"->"James Harden"@0] | ("Russell Westbrook") | [:like "Chris Paul"->"Dwyane Wade"@0] | ("Paul George") | [:like "Luka Doncic"->"Dirk Nowitzki"@0] | | + | [:like "Tiago Splitter"->"Tim Duncan"@0] | ("Shaquile O'Neal") | [:like "Dejounte Murray"->"Kevin Durant"@0] | ("Yao Ming") | [:like "Chris Paul"->"LeBron James"@0] | | [:like "Luka Doncic"->"Kristaps Porzingis"@0] | | + | [:like "Tony Parker"->"Tim Duncan"@0] | ("Tony Parker") | [:like "Dejounte Murray"->"Kyle Anderson"@0] | ("JaVale McGee") | [:like "Tracy McGrady"->"Rudy Gay"@0] | | [:like "Dirk Nowitzki"->"Dwyane Wade"@0] | | + | [:like "Tim Duncan"->"Manu Ginobili"@0] | | [:like "Dejounte Murray"->"LeBron James"@0] | | [:like "Carmelo Anthony"->"LeBron James"@0] | | [:like "Rajon Rondo"->"Ray Allen"@0] | | + | [:like "Tim Duncan"->"Tony Parker"@0] | | [:like "Dejounte Murray"->"Manu Ginobili"@0] | | [:like "Dwyane Wade"->"LeBron James"@0] | | [:like "Ray Allen"->"Rajon Rondo"@0] | | + | | | [:like "Dejounte Murray"->"Marco Belinelli"@0] | | [:like "Kyrie Irving"->"LeBron James"@0] | | | | + | | | [:like "Dejounte Murray"->"Russell Westbrook"@0] | | [:like "LeBron James"->"Ray Allen"@0] | | | | + | | | [:like "Dejounte Murray"->"Tony Parker"@0] | | [:like "Paul George"->"Russell Westbrook"@0] | | | | + | | | [:like "Marco Belinelli"->"Danny Green"@0] | | [:like "Russell Westbrook"->"Paul George"@0] | | | | + | | | [:like "Danny Green"->"LeBron James"@0] | | [:like "Yao Ming"->"Tracy McGrady"@0] | | | | + | | | [:like "Danny Green"->"Marco Belinelli"@0] | | | | | | + | | | [:like "Marco Belinelli"->"Tony Parker"@0] | | | | | | + | | | [:like "Tiago Splitter"->"Manu Ginobili"@0] | | | | | | + | | | [:like "Tony Parker"->"Manu Ginobili"@0] | | | | | | + | | | [: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: + | nodes | relationships | + | [("Tim Duncan")] | <[edge1]> | + | <[vertex2]> | <[edge2]> | + | <[vertex3]> | <[edge3]> | + | <[vertex4]> | <[edge4]> | + | <[vertex5]> | [] | diff --git a/tests/tck/features/subgraph/subgraph.feature b/tests/tck/features/subgraph/subgraph.feature index 759e9abee7a..cb1d90ee473 100644 --- a/tests/tck/features/subgraph/subgraph.feature +++ b/tests/tck/features/subgraph/subgraph.feature @@ -18,6 +18,21 @@ Feature: subgraph GET SUBGRAPH WITH PROP FROM $a.id """ Then a SemanticError should be raised at runtime: `$a.id', not exist variable `a' + When executing query: + """ + GET SUBGRAPH WITH PROP FROM "Tim Duncan" YIELD vertexs + """ + 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 vertices, edgesa + """ + Then a SyntaxError should be raised at runtime: please add alias when using vertices. near `vertices' + When executing query: + """ + GET SUBGRAPH WITH PROP 0 STEPS FROM "Tim Duncan" YIELD edges + """ + Then a SyntaxError should be raised at runtime: please add alias when using edges. near `edges' When executing query: """ GO FROM "Tim Duncan" OVER like YIELD $$.player.age AS id | GET SUBGRAPH WITH PROP FROM $-.id @@ -366,6 +381,661 @@ Feature: subgraph | [("Dejounte Murray"), ("James Harden")] | <[edge3]> | | <[vertex4]> | <[edge4]> | + Scenario: yield bidirect edge + When executing query: + """ + GET SUBGRAPH WITH PROP FROM 'Tony Parker' BOTH like YIELD vertices as a, edges as b + """ + Then define some list variables: + | edge1 | vertex2 | edge2 | + | [:like "Boris Diaw"->"Tony Parker"@0] | ("Manu Ginobili") | [:like "Manu Ginobili"->"Tim Duncan"@0] | + | [:like "Dejounte Murray"->"Tony Parker"@0] | ("Marco Belinelli") | [:like "Dejounte Murray"->"Marco Belinelli"@0] | + | [:like "LaMarcus Aldridge"->"Tony Parker"@0] | ("Tim Duncan") | [:like "Marco Belinelli"->"Tim Duncan"@0] | + | [:like "Marco Belinelli"->"Tony Parker"@0] | ("Dejounte Murray") | [:like "Tim Duncan"->"Manu Ginobili"@0] | + | [:like "Tim Duncan"->"Tony Parker"@0] | ("LaMarcus Aldridge") | [:like "Boris Diaw"->"Tim Duncan"@0] | + | [:like "Tony Parker"->"LaMarcus Aldridge"@0] | ("Boris Diaw") | [:like "Dejounte Murray"->"Manu Ginobili"@0] | + | [: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: + | a | b | + | [("Tony Parker")] | <[edge1]> | + | <[vertex2]> | <[edge2]> | + + Scenario: yield pipe + When executing query: + """ + GO FROM 'Tim Duncan' over serve YIELD serve._src AS id | GET SUBGRAPH WITH PROP FROM $-.id YIELD VERTICES as a, EDGES as b + """ + Then define some list variables: + | edge1 | vertex2 | edge2 | + | [:teammate "Manu Ginobili"->"Tim Duncan"@0] | ("Danny Green") | [:like "Dejounte Murray"->"Danny Green"@0] | + | [:teammate "Tony Parker"->"Tim Duncan"@0] | ("Manu Ginobili") | [:like "Marco Belinelli"->"Danny Green"@0] | + | [:like "Aron Baynes"->"Tim Duncan"@0] | ("Aron Baynes") | [:like "Danny Green"->"Marco Belinelli"@0] | + | [:like "Boris Diaw"->"Tim Duncan"@0] | ("Boris Diaw") | [:serve "Danny Green"->"Spurs"@0] | + | [:like "Danny Green"->"Tim Duncan"@0] | ("Shaquile O\'Neal") | [:teammate "Tony Parker"->"Manu Ginobili"@0] | + | [:like "Dejounte Murray"->"Tim Duncan"@0] | ("Tony Parker") | [:like "Dejounte Murray"->"Manu Ginobili"@0] | + | [:like "LaMarcus Aldridge"->"Tim Duncan"@0] | ("Spurs") | [:like "Tiago Splitter"->"Manu Ginobili"@0] | + | [:like "Manu Ginobili"->"Tim Duncan"@0] | ("Dejounte Murray") | [:like "Tony Parker"->"Manu Ginobili"@0] | + | [:like "Marco Belinelli"->"Tim Duncan"@0] | ("LaMarcus Aldridge") | [:serve "Manu Ginobili"->"Spurs"@0] | + | [:like "Shaquile O\'Neal"->"Tim Duncan"@0] | ("Marco Belinelli") | [:teammate "Manu Ginobili"->"Tony Parker"@0] | + | [:like "Tiago Splitter"->"Tim Duncan"@0] | ("Tiago Splitter") | [:serve "Aron Baynes"->"Spurs"@0] | + | [:like "Tony Parker"->"Tim Duncan"@0] | | [:like "Boris Diaw"->"Tony Parker"@0] | + | [:like "Tim Duncan"->"Manu Ginobili"@0] | | [:serve "Boris Diaw"->"Spurs"@0] | + | [:like "Tim Duncan"->"Tony Parker"@0] | | [:like "Dejounte Murray"->"Tony Parker"@0] | + | [:serve "Tim Duncan"->"Spurs"@0] | | [:like "LaMarcus Aldridge"->"Tony Parker"@0] | + | [:teammate "Tim Duncan"->"Danny Green"@0] | | [:like "Marco Belinelli"->"Tony Parker"@0] | + | [:teammate "Tim Duncan"->"LaMarcus Aldridge"@0] | | [:like "Tony Parker"->"LaMarcus Aldridge"@0] | + | [:teammate "Tim Duncan"->"Manu Ginobili"@0] | | [:serve "Tony Parker"->"Spurs"@0] | + | [:teammate "Tim Duncan"->"Tony Parker"@0] | | [:teammate "Tony Parker"->"LaMarcus Aldridge"@0] | + | | | [:serve "Dejounte Murray"->"Spurs"@0] | + | | | [:serve "LaMarcus Aldridge"->"Spurs"@0] | + | | | [:serve "Marco Belinelli"->"Spurs"@0] | + | | | [:serve "Tiago Splitter"->"Spurs"@0] | + | | | [:serve "Marco Belinelli"->"Spurs"@1] | + | | | [:like "Dejounte Murray"->"Marco Belinelli"@0] | + Then the result should be, in any order, with relax comparison: + | a | b | + | [("Tim Duncan")] | <[edge1]> | + | <[vertex2]> | <[edge2]> | + + Scenario: yield var + When executing query: + """ + $a = GO FROM 'Tim Duncan' over serve YIELD serve._src AS id; + GET SUBGRAPH WITH PROP FROM $a.id YIELD VERTICES as a, EDGES as b + """ + Then define some list variables: + | edge1 | vertex2 | edge2 | + | [:teammate "Manu Ginobili"->"Tim Duncan"@0] | ("Danny Green") | [:like "Dejounte Murray"->"Danny Green"@0] | + | [:teammate "Tony Parker"->"Tim Duncan"@0] | ("Manu Ginobili") | [:like "Marco Belinelli"->"Danny Green"@0] | + | [:like "Aron Baynes"->"Tim Duncan"@0] | ("Aron Baynes") | [:like "Danny Green"->"Marco Belinelli"@0] | + | [:like "Boris Diaw"->"Tim Duncan"@0] | ("Boris Diaw") | [:serve "Danny Green"->"Spurs"@0] | + | [:like "Danny Green"->"Tim Duncan"@0] | ("Shaquile O\'Neal") | [:teammate "Tony Parker"->"Manu Ginobili"@0] | + | [:like "Dejounte Murray"->"Tim Duncan"@0] | ("Tony Parker") | [:like "Dejounte Murray"->"Manu Ginobili"@0] | + | [:like "LaMarcus Aldridge"->"Tim Duncan"@0] | ("Spurs") | [:like "Tiago Splitter"->"Manu Ginobili"@0] | + | [:like "Manu Ginobili"->"Tim Duncan"@0] | ("Dejounte Murray") | [:like "Tony Parker"->"Manu Ginobili"@0] | + | [:like "Marco Belinelli"->"Tim Duncan"@0] | ("LaMarcus Aldridge") | [:serve "Manu Ginobili"->"Spurs"@0] | + | [:like "Shaquile O\'Neal"->"Tim Duncan"@0] | ("Marco Belinelli") | [:teammate "Manu Ginobili"->"Tony Parker"@0] | + | [:like "Tiago Splitter"->"Tim Duncan"@0] | ("Tiago Splitter") | [:serve "Aron Baynes"->"Spurs"@0] | + | [:like "Tony Parker"->"Tim Duncan"@0] | | [:like "Boris Diaw"->"Tony Parker"@0] | + | [:like "Tim Duncan"->"Manu Ginobili"@0] | | [:serve "Boris Diaw"->"Spurs"@0] | + | [:like "Tim Duncan"->"Tony Parker"@0] | | [:like "Dejounte Murray"->"Tony Parker"@0] | + | [:serve "Tim Duncan"->"Spurs"@0] | | [:like "LaMarcus Aldridge"->"Tony Parker"@0] | + | [:teammate "Tim Duncan"->"Danny Green"@0] | | [:like "Marco Belinelli"->"Tony Parker"@0] | + | [:teammate "Tim Duncan"->"LaMarcus Aldridge"@0] | | [:like "Tony Parker"->"LaMarcus Aldridge"@0] | + | [:teammate "Tim Duncan"->"Manu Ginobili"@0] | | [:serve "Tony Parker"->"Spurs"@0] | + | [:teammate "Tim Duncan"->"Tony Parker"@0] | | [:teammate "Tony Parker"->"LaMarcus Aldridge"@0] | + | | | [:serve "Dejounte Murray"->"Spurs"@0] | + | | | [:serve "LaMarcus Aldridge"->"Spurs"@0] | + | | | [:serve "Marco Belinelli"->"Spurs"@0] | + | | | [:serve "Tiago Splitter"->"Spurs"@0] | + | | | [:serve "Marco Belinelli"->"Spurs"@1] | + | | | [:like "Dejounte Murray"->"Marco Belinelli"@0] | + Then the result should be, in any order, with relax comparison: + | a | b | + | [("Tim Duncan")] | <[edge1]> | + | <[vertex2]> | <[edge2]> | + + Scenario: yield many steps + When executing query: + """ + GET SUBGRAPH WITH PROP 4 STEPS FROM 'Yao Ming' IN teammate OUT serve YIELD VERTICES as a, EDGES as b + """ + Then the result should be, in any order, with relax comparison: + | a | b | + | [("Yao Ming")] | [[:serve "Yao Ming"->"Rockets"@0]] | + | [("Rockets")] | [] | + When executing query: + """ + GET SUBGRAPH WITH PROP 4 STEPS FROM 'NOBODY' IN teammate OUT serve YIELD VERTICES as nodes, EDGES as relationships + """ + Then the result should be, in any order, with relax comparison: + | nodes | relationships | + | [("NOBODY")] | [] | + When executing query: + """ + GET SUBGRAPH WITH PROP 4 steps from 'Yao Ming' IN teammate OUT serve BOTH like YIELD VERTICES as nodes, EDGES as relationships + """ + Then define some list variables: + | edge1 | vertex2 | edge2 | vertex3 | edge3 | vertex4 | edge4 | vertex5 | edge5 | + | [:serve "Yao Ming"->"Rockets"@0] | ("Shaquile O'Neal") | [:serve "Shaquile O'Neal"->"Cavaliers"@0] | ("Kobe Bryant") | [:serve "Kobe Bryant"->"Lakers"@0] | ("Manu Ginobili") | [:serve "Manu Ginobili"->"Spurs"@0] | ("Dirk Nowitzki") | [:like "Dirk Nowitzki"->"Steve Nash"@0] | + | [:like "Yao Ming"->"Shaquile O'Neal"@0] | ("Tracy McGrady") | [:serve "Shaquile O'Neal"->"Celtics"@0] | ("Grant Hill") | [:like "Paul Gasol"->"Kobe Bryant"@0] | ("Paul Gasol") | [:teammate "Tim Duncan"->"Manu Ginobili"@0] | ("Kevin Durant") | [:serve "Kevin Durant"->"Warriors"@0] | + | [:like "Yao Ming"->"Tracy McGrady"@0] | ("Rockets") | [:serve "Shaquile O'Neal"->"Heat"@0] | ("Vince Carter") | [:serve "Grant Hill"->"Clippers"@0] | ("Jason Kidd") | [:teammate "Tony Parker"->"Manu Ginobili"@0] | ("Damian Lillard") | [:serve "Damian Lillard"->"Trail Blazers"@0] | + | | | [:serve "Shaquile O'Neal"->"Lakers"@0] | ("Tim Duncan") | [:serve "Grant Hill"->"Magic"@0] | ("Tony Parker") | [:like "Dejounte Murray"->"Manu Ginobili"@0] | ("James Harden") | [:serve "James Harden"->"Rockets"@0] | + | | | [:serve "Shaquile O'Neal"->"Magic"@0] | ("JaVale McGee") | [:serve "Grant Hill"->"Pistons"@0] | ("Marco Belinelli") | [:like "Tiago Splitter"->"Manu Ginobili"@0] | ("Chris Paul") | [:like "Steve Nash"->"Dirk Nowitzki"@0] | + | | | [:serve "Shaquile O'Neal"->"Suns"@0] | ("Rudy Gay") | [:serve "Grant Hill"->"Suns"@0] | ("Dejounte Murray") | [:like "Tony Parker"->"Manu Ginobili"@0] | ("LeBron James") | [:like "Russell Westbrook"->"James Harden"@0] | + | | | [:like "Shaquile O'Neal"->"JaVale McGee"@0] | ("Magic") | [:serve "Vince Carter"->"Grizzlies"@0] | ("Aron Baynes") | [:serve "Paul Gasol"->"Bucks"@0] | ("Steve Nash") | [:like "James Harden"->"Russell Westbrook"@0] | + | | | [:like "Shaquile O'Neal"->"Tim Duncan"@0] | ("Spurs") | [:serve "Vince Carter"->"Hawks"@0] | ("Boris Diaw") | [:serve "Paul Gasol"->"Bulls"@0] | ("Marc Gasol") | [:serve "Chris Paul"->"Clippers"@0] | + | | | [:serve "Tracy McGrady"->"Magic"@0] | ("Celtics") | [:serve "Vince Carter"->"Kings"@0] | ("Danny Green") | [:serve "Paul Gasol"->"Grizzlies"@0] | ("Kyle Anderson") | [:serve "Chris Paul"->"Hornets"@0] | + | | | [:serve "Tracy McGrady"->"Raptors"@0] | ("Heat") | [:serve "Vince Carter"->"Magic"@0] | ("LaMarcus Aldridge") | [:serve "Paul Gasol"->"Lakers"@0] | ("Russell Westbrook") | [:serve "Chris Paul"->"Rockets"@0] | + | | | [:serve "Tracy McGrady"->"Rockets"@0] | ("Suns") | [:serve "Vince Carter"->"Mavericks"@0] | ("Tiago Splitter") | [:serve "Paul Gasol"->"Spurs"@0] | ("76ers") | [:serve "Dirk Nowitzki"->"Mavericks"@0] | + | | | [:serve "Tracy McGrady"->"Spurs"@0] | ("Lakers") | [:serve "Vince Carter"->"Nets"@0] | ("Pistons") | [:like "Marc Gasol"->"Paul Gasol"@0] | ("Hornets") | [:like "Chris Paul"->"LeBron James"@0] | + | | | [:like "Grant Hill"->"Tracy McGrady"@0] | ("Cavaliers") | [:serve "Vince Carter"->"Raptors"@0] | ("Nets") | [:like "Paul Gasol"->"Marc Gasol"@0] | ("Bucks") | [:serve "Steve Nash"->"Lakers"@0] | + | | | [:like "Vince Carter"->"Tracy McGrady"@0] | ("Raptors") | [:serve "Vince Carter"->"Suns"@0] | ("Kings") | [:serve "Jason Kidd"->"Knicks"@0] | ("Knicks") | [:serve "Steve Nash"->"Mavericks"@0] | + | | | [:like "Tracy McGrady"->"Grant Hill"@0] | | [:like "Jason Kidd"->"Vince Carter"@0] | ("Clippers") | [:serve "Jason Kidd"->"Mavericks"@0] | ("Bulls") | [:serve "Steve Nash"->"Suns"@0] | + | | | [:like "Tracy McGrady"->"Kobe Bryant"@0] | | [:like "Vince Carter"->"Jason Kidd"@0] | ("Mavericks") | [:serve "Jason Kidd"->"Nets"@0] | ("Trail Blazers") | [:serve "Steve Nash"->"Suns"@1] | + | | | [:like "Tracy McGrady"->"Rudy Gay"@0] | | [:serve "Tim Duncan"->"Spurs"@0] | ("Hawks") | [:serve "Jason Kidd"->"Suns"@0] | ("Jazz") | [:serve "LeBron James"->"Cavaliers"@1] | + | | | | | [:teammate "Manu Ginobili"->"Tim Duncan"@0] | ("Warriors") | [:serve "Jason Kidd"->"Mavericks"@1] | | [:serve "LeBron James"->"Lakers"@0] | + | | | | | [:teammate "Tony Parker"->"Tim Duncan"@0] | ("Nuggets") | [:like "Dirk Nowitzki"->"Jason Kidd"@0] | | [:serve "LeBron James"->"Heat"@0] | + | | | | | [:like "Aron Baynes"->"Tim Duncan"@0] | ("Grizzlies") | [:like "Steve Nash"->"Jason Kidd"@0] | | [:serve "Marc Gasol"->"Grizzlies"@0] | + | | | | | [:like "Boris Diaw"->"Tim Duncan"@0] | ("Wizards") | [:like "Jason Kidd"->"Dirk Nowitzki"@0] | | [:serve "Marc Gasol"->"Raptors"@0] | + | | | | | [:like "Danny Green"->"Tim Duncan"@0] | | [:like "Jason Kidd"->"Steve Nash"@0] | | [:serve "Kyle Anderson"->"Grizzlies"@0] | + | | | | | [:like "Dejounte Murray"->"Tim Duncan"@0] | | [:serve "Tony Parker"->"Hornets"@0] | | [:serve "Kyle Anderson"->"Spurs"@0] | + | | | | | [:like "LaMarcus Aldridge"->"Tim Duncan"@0] | | [:serve "Tony Parker"->"Spurs"@0] | | [:teammate "Tony Parker"->"Kyle Anderson"@0] | + | | | | | [:like "Manu Ginobili"->"Tim Duncan"@0] | | [:teammate "Manu Ginobili"->"Tony Parker"@0] | | [:serve "LeBron James"->"Cavaliers"@0] | + | | | | | [:like "Marco Belinelli"->"Tim Duncan"@0] | | [:teammate "Tim Duncan"->"Tony Parker"@0] | | | + | | | | | [:like "Tiago Splitter"->"Tim Duncan"@0] | | [:like "Boris Diaw"->"Tony Parker"@0] | | | + | | | | | [:like "Tony Parker"->"Tim Duncan"@0] | | [:like "Dejounte Murray"->"Tony Parker"@0] | | | + | | | | | [:like "Tim Duncan"->"Manu Ginobili"@0] | | [:like "LaMarcus Aldridge"->"Tony Parker"@0] | | | + | | | | | [:like "Tim Duncan"->"Tony Parker"@0] | | [:like "Marco Belinelli"->"Tony Parker"@0] | | | + | | | | | [:serve "JaVale McGee"->"Lakers"@0] | | [:like "Tony Parker"->"LaMarcus Aldridge"@0] | | | + | | | | | [:serve "JaVale McGee"->"Mavericks"@0] | | [:serve "Marco Belinelli"->"76ers"@0] | | | + | | | | | [:serve "JaVale McGee"->"Nuggets"@0] | | [:serve "Marco Belinelli"->"Bulls"@0] | | | + | | | | | [:serve "JaVale McGee"->"Warriors"@0] | | [:serve "Marco Belinelli"->"Hawks"@0] | | | + | | | | | [:serve "JaVale McGee"->"Wizards"@0] | | [:serve "Marco Belinelli"->"Hornets"@0] | | | + | | | | | [:serve "Rudy Gay"->"Grizzlies"@0] | | [:serve "Marco Belinelli"->"Kings"@0] | | | + | | | | | [:serve "Rudy Gay"->"Kings"@0] | | [:serve "Marco Belinelli"->"Raptors"@0] | | | + | | | | | [:serve "Rudy Gay"->"Raptors"@0] | | [:serve "Marco Belinelli"->"Spurs"@0] | | | + | | | | | [:serve "Rudy Gay"->"Spurs"@0] | | [:serve "Marco Belinelli"->"Warriors"@0] | | | + | | | | | [:like "Rudy Gay"->"LaMarcus Aldridge"@0] | | [:serve "Marco Belinelli"->"Hornets"@1] | | | + | | | | | | | [:serve "Marco Belinelli"->"Spurs"@1] | | | + | | | | | | | [:like "Danny Green"->"Marco Belinelli"@0] | | | + | | | | | | | [:like "Dejounte Murray"->"Marco Belinelli"@0] | | | + | | | | | | | [:like "Marco Belinelli"->"Danny Green"@0] | | | + | | | | | | | [:serve "Dejounte Murray"->"Spurs"@0] | | | + | | | | | | | [:like "Dejounte Murray"->"Chris Paul"@0] | | | + | | | | | | | [:like "Dejounte Murray"->"Danny Green"@0] | | | + | | | | | | | [:like "Dejounte Murray"->"James Harden"@0] | | | + | | | | | | | [:like "Dejounte Murray"->"Kevin Durant"@0] | | | + | | | | | | | [:like "Dejounte Murray"->"Kyle Anderson"@0] | | | + | | | | | | | [:like "Dejounte Murray"->"LeBron James"@0] | | | + | | | | | | | [:like "Dejounte Murray"->"Russell Westbrook"@0] | | | + | | | | | | | [:serve "Aron Baynes"->"Celtics"@0] | | | + | | | | | | | [:serve "Aron Baynes"->"Pistons"@0] | | | + | | | | | | | [:serve "Aron Baynes"->"Spurs"@0] | | | + | | | | | | | [:serve "Boris Diaw"->"Hawks"@0] | | | + | | | | | | | [:serve "Boris Diaw"->"Hornets"@0] | | | + | | | | | | | [:serve "Boris Diaw"->"Jazz"@0] | | | + | | | | | | | [:serve "Boris Diaw"->"Spurs"@0] | | | + | | | | | | | [:serve "Boris Diaw"->"Suns"@0] | | | + | | | | | | | [:serve "Danny Green"->"Cavaliers"@0] | | | + | | | | | | | [:serve "Danny Green"->"Raptors"@0] | | | + | | | | | | | [:serve "Danny Green"->"Spurs"@0] | | | + | | | | | | | [:teammate "Tim Duncan"->"Danny Green"@0] | | | + | | | | | | | [:like "Danny Green"->"LeBron James"@0] | | | + | | | | | | | [:serve "LaMarcus Aldridge"->"Spurs"@0] | | | + | | | | | | | [:serve "LaMarcus Aldridge"->"Trail Blazers"@0] | | | + | | | | | | | [:teammate "Tim Duncan"->"LaMarcus Aldridge"@0] | | | + | | | | | | | [:teammate "Tony Parker"->"LaMarcus Aldridge"@0] | | | + | | | | | | | [:like "Damian Lillard"->"LaMarcus Aldridge"@0] | | | + | | | | | | | [:serve "Tiago Splitter"->"76ers"@0] | | | + | | | | | | | [:serve "Tiago Splitter"->"Hawks"@0] | | | + | | | | | | | [:serve "Tiago Splitter"->"Spurs"@0] | | | + Then the result should be, in any order, with relax comparison: + | nodes | relationships | + | [("Yao Ming")] | <[edge1]> | + | <[vertex2]> | <[edge2]> | + | <[vertex3]> | <[edge3]> | + | <[vertex4]> | <[edge4]> | + | <[vertex5]> | <[edge5]> | + When executing query: + """ + GET SUBGRAPH WITH PROP 5 steps from 'Tony Parker' IN teammate OUT serve BOTH like YIELD VERTICES as nodes, EDGES as relationships + """ + Then define some list variables: + | edge1 | vertex2 | edge2 | vertex3 | edge3 | vertex4 | edge4 | vertex5 | edge5 | vertex6 | edge6 | + | [:serve "Tony Parker"->"Hornets"@0] | ("Tim Duncan") | [:serve "Tim Duncan"->"Spurs"@0] | ("Aron Baynes") | [:serve "Aron Baynes"->"Celtics"@0] | ("Yao Ming") | [:serve "Yao Ming"->"Rockets"@0] | ("Grant Hill") | [:serve "Grant Hill"->"Clippers"@0] | ("Steve Nash") | [:serve "Steve Nash"->"Lakers"@0] | + | [:serve "Tony Parker"->"Spurs"@0] | ("Boris Diaw") | [:teammate "Manu Ginobili"->"Tim Duncan"@0] | ("Rudy Gay") | [:serve "Aron Baynes"->"Pistons"@0] | ("Ray Allen") | [:like "Yao Ming"->"Tracy McGrady"@0] | ("Kristaps Porzingis") | [:serve "Grant Hill"->"Magic"@0] | ("Paul Gasol") | [:serve "Steve Nash"->"Mavericks"@0] | + | [:teammate "Manu Ginobili"->"Tony Parker"@0] | ("LaMarcus Aldridge") | [:teammate "Tony Parker"->"Tim Duncan"@0] | ("Damian Lillard") | [:serve "Aron Baynes"->"Spurs"@0] | ("Blake Griffin") | [:serve "Ray Allen"->"Bucks"@0] | ("Dirk Nowitzki") | [:serve "Grant Hill"->"Pistons"@0] | ("Jason Kidd") | [:serve "Steve Nash"->"Suns"@0] | + | [:teammate "Tim Duncan"->"Tony Parker"@0] | ("Manu Ginobili") | [:like "Aron Baynes"->"Tim Duncan"@0] | ("Kevin Durant") | [:serve "Rudy Gay"->"Grizzlies"@0] | ("Paul George") | [:serve "Ray Allen"->"Celtics"@0] | ("Rajon Rondo") | [:serve "Grant Hill"->"Suns"@0] | ("Pelicans") | [:serve "Steve Nash"->"Suns"@1] | + | [:like "Boris Diaw"->"Tony Parker"@0] | ("Marco Belinelli") | [:like "Boris Diaw"->"Tim Duncan"@0] | ("Shaquile O'Neal") | [:serve "Rudy Gay"->"Kings"@0] | ("JaVale McGee") | [:serve "Ray Allen"->"Heat"@0] | ("Vince Carter") | [:serve "Kristaps Porzingis"->"Knicks"@0] | ("Nets") | [:like "Jason Kidd"->"Steve Nash"@0] | + | [:like "Dejounte Murray"->"Tony Parker"@0] | ("Dejounte Murray") | [:like "Danny Green"->"Tim Duncan"@0] | ("Tiago Splitter") | [:serve "Rudy Gay"->"Raptors"@0] | ("Luka Doncic") | [:serve "Ray Allen"->"Thunders"@0] | ("Kobe Bryant") | [:serve "Kristaps Porzingis"->"Mavericks"@0] | | [:serve "Paul Gasol"->"Spurs"@0] | + | [:like "LaMarcus Aldridge"->"Tony Parker"@0] | ("Hornets") | [:like "Dejounte Murray"->"Tim Duncan"@0] | ("Russell Westbrook") | [:serve "Rudy Gay"->"Spurs"@0] | ("Carmelo Anthony") | [:like "Rajon Rondo"->"Ray Allen"@0] | ("Wizards") | [:serve "Dirk Nowitzki"->"Mavericks"@0] | | [:like "Steve Nash"->"Jason Kidd"@0] | + | [:like "Marco Belinelli"->"Tony Parker"@0] | ("Spurs") | [:like "LaMarcus Aldridge"->"Tim Duncan"@0] | ("Danny Green") | [:like "Tracy McGrady"->"Rudy Gay"@0] | ("Tracy McGrady") | [:like "Ray Allen"->"Rajon Rondo"@0] | ("Pacers") | [:like "Jason Kidd"->"Dirk Nowitzki"@0] | | [:serve "Paul Gasol"->"Lakers"@0] | + | [:like "Tim Duncan"->"Tony Parker"@0] | | [:like "Manu Ginobili"->"Tim Duncan"@0] | ("Kyle Anderson") | [:serve "Damian Lillard"->"Trail Blazers"@0] | ("Dwyane Wade") | [:serve "Blake Griffin"->"Clippers"@0] | ("Knicks") | [:like "Steve Nash"->"Dirk Nowitzki"@0] | | [:serve "Jason Kidd"->"Knicks"@0] | + | [:like "Tony Parker"->"LaMarcus Aldridge"@0] | | [:like "Marco Belinelli"->"Tim Duncan"@0] | ("James Harden") | [:serve "Kevin Durant"->"Thunders"@0] | ("Kyrie Irving") | [:serve "Blake Griffin"->"Pistons"@0] | ("Bucks") | [:like "Dirk Nowitzki"->"Jason Kidd"@0] | | [:serve "Jason Kidd"->"Mavericks"@0] | + | [:like "Tony Parker"->"Manu Ginobili"@0] | | [:like "Shaquile O'Neal"->"Tim Duncan"@0] | ("LeBron James") | [:serve "Kevin Durant"->"Warriors"@0] | ("Cavaliers") | [:serve "Paul George"->"Pacers"@0] | ("Mavericks") | [:like "Dirk Nowitzki"->"Steve Nash"@0] | | [:serve "Jason Kidd"->"Nets"@0] | + | [:like "Tony Parker"->"Tim Duncan"@0] | | [:like "Tiago Splitter"->"Tim Duncan"@0] | ("Chris Paul") | [:serve "Shaquile O'Neal"->"Cavaliers"@0] | ("Celtics") | [:serve "Paul George"->"Thunders"@0] | ("Nuggets") | [:serve "Rajon Rondo"->"Bulls"@0] | | [:serve "Jason Kidd"->"Suns"@0] | + | | | [:like "Tim Duncan"->"Manu Ginobili"@0] | ("Bulls") | [:serve "Shaquile O'Neal"->"Celtics"@0] | ("Pistons") | [:serve "JaVale McGee"->"Lakers"@0] | | [:serve "Rajon Rondo"->"Celtics"@0] | | [:serve "Jason Kidd"->"Mavericks"@1] | + | | | [:serve "Boris Diaw"->"Hawks"@0] | ("Jazz") | [:serve "Shaquile O'Neal"->"Heat"@0] | ("Grizzlies") | [:serve "JaVale McGee"->"Mavericks"@0] | | [:serve "Rajon Rondo"->"Kings"@0] | | [:serve "Paul Gasol"->"Bucks"@0] | + | | | [:serve "Boris Diaw"->"Hornets"@0] | ("Hawks") | [:serve "Shaquile O'Neal"->"Lakers"@0] | ("Heat") | [:serve "JaVale McGee"->"Nuggets"@0] | | [:serve "Rajon Rondo"->"Lakers"@0] | | [:serve "Paul Gasol"->"Bulls"@0] | + | | | [:serve "Boris Diaw"->"Jazz"@0] | ("Warriors") | [:serve "Shaquile O'Neal"->"Magic"@0] | ("Magic") | [:serve "JaVale McGee"->"Warriors"@0] | | [:serve "Rajon Rondo"->"Mavericks"@0] | | [:serve "Paul Gasol"->"Grizzlies"@0] | + | | | [:serve "Boris Diaw"->"Spurs"@0] | ("Suns") | [:serve "Shaquile O'Neal"->"Suns"@0] | ("Lakers") | [:serve "JaVale McGee"->"Wizards"@0] | | [:serve "Rajon Rondo"->"Pelicans"@0] | | | + | | | [:serve "Boris Diaw"->"Suns"@0] | ("Trail Blazers") | [:like "Yao Ming"->"Shaquile O'Neal"@0] | ("Clippers") | [:serve "Luka Doncic"->"Mavericks"@0] | | [:serve "Vince Carter"->"Grizzlies"@0] | | | + | | | [:serve "LaMarcus Aldridge"->"Spurs"@0] | ("Kings") | [:like "Shaquile O'Neal"->"JaVale McGee"@0] | ("Thunders") | [:like "Kristaps Porzingis"->"Luka Doncic"@0] | | [:serve "Vince Carter"->"Hawks"@0] | | | + | | | [:serve "LaMarcus Aldridge"->"Trail Blazers"@0] | ("Raptors") | [:serve "Tiago Splitter"->"76ers"@0] | ("Rockets") | [:like "Luka Doncic"->"Dirk Nowitzki"@0] | | [:serve "Vince Carter"->"Kings"@0] | | | + | | | [:teammate "Tim Duncan"->"LaMarcus Aldridge"@0] | ("76ers") | [:serve "Tiago Splitter"->"Hawks"@0] | | [:like "Luka Doncic"->"Kristaps Porzingis"@0] | | [:serve "Vince Carter"->"Magic"@0] | | | + | | | [:teammate "Tony Parker"->"LaMarcus Aldridge"@0] | | [:serve "Tiago Splitter"->"Spurs"@0] | | [:serve "Carmelo Anthony"->"Knicks"@0] | | [:serve "Vince Carter"->"Mavericks"@0] | | | + | | | [:like "Damian Lillard"->"LaMarcus Aldridge"@0] | | [:serve "Russell Westbrook"->"Thunders"@0] | | [:serve "Carmelo Anthony"->"Nuggets"@0] | | [:serve "Vince Carter"->"Nets"@0] | | | + | | | [:like "Rudy Gay"->"LaMarcus Aldridge"@0] | | [:like "James Harden"->"Russell Westbrook"@0] | | [:serve "Carmelo Anthony"->"Rockets"@0] | | [:serve "Vince Carter"->"Raptors"@0] | | | + | | | [:serve "Manu Ginobili"->"Spurs"@0] | | [:like "Paul George"->"Russell Westbrook"@0] | | [:serve "Carmelo Anthony"->"Thunders"@0] | | [:serve "Vince Carter"->"Suns"@0] | | | + | | | [:teammate "Tim Duncan"->"Manu Ginobili"@0] | | [:like "Russell Westbrook"->"James Harden"@0] | | [:like "Dwyane Wade"->"Carmelo Anthony"@0] | | [:like "Jason Kidd"->"Vince Carter"@0] | | | + | | | [:teammate "Tony Parker"->"Manu Ginobili"@0] | | [:like "Russell Westbrook"->"Paul George"@0] | | [:like "Carmelo Anthony"->"Dwyane Wade"@0] | | [:like "Vince Carter"->"Jason Kidd"@0] | | | + | | | [:like "Dejounte Murray"->"Manu Ginobili"@0] | | [:serve "Danny Green"->"Cavaliers"@0] | | [:serve "Tracy McGrady"->"Magic"@0] | | [:serve "Kobe Bryant"->"Lakers"@0] | | | + | | | [:like "Tiago Splitter"->"Manu Ginobili"@0] | | [:serve "Danny Green"->"Raptors"@0] | | [:serve "Tracy McGrady"->"Raptors"@0] | | [:like "Paul Gasol"->"Kobe Bryant"@0] | | | + | | | [:serve "Marco Belinelli"->"76ers"@0] | | [:serve "Danny Green"->"Spurs"@0] | | [:serve "Tracy McGrady"->"Rockets"@0] | | | | | + | | | [:serve "Marco Belinelli"->"Bulls"@0] | | [:teammate "Tim Duncan"->"Danny Green"@0] | | [:serve "Tracy McGrady"->"Spurs"@0] | | | | | + | | | [:serve "Marco Belinelli"->"Hawks"@0] | | [:like "Danny Green"->"LeBron James"@0] | | [:like "Grant Hill"->"Tracy McGrady"@0] | | | | | + | | | [:serve "Marco Belinelli"->"Hornets"@0] | | [:serve "Kyle Anderson"->"Grizzlies"@0] | | [:like "Vince Carter"->"Tracy McGrady"@0] | | | | | + | | | [:serve "Marco Belinelli"->"Kings"@0] | | [:serve "Kyle Anderson"->"Spurs"@0] | | [:like "Tracy McGrady"->"Grant Hill"@0] | | | | | + | | | [:serve "Marco Belinelli"->"Raptors"@0] | | [:teammate "Tony Parker"->"Kyle Anderson"@0] | | [:like "Tracy McGrady"->"Kobe Bryant"@0] | | | | | + | | | [:serve "Marco Belinelli"->"Spurs"@0] | | [:serve "James Harden"->"Rockets"@0] | | [:serve "Dwyane Wade"->"Bulls"@0] | | | | | + | | | [:serve "Marco Belinelli"->"Warriors"@0] | | [:serve "James Harden"->"Thunders"@0] | | [:serve "Dwyane Wade"->"Cavaliers"@0] | | | | | + | | | [:serve "Marco Belinelli"->"Hornets"@1] | | [:like "Luka Doncic"->"James Harden"@0] | | [:serve "Dwyane Wade"->"Heat"@0] | | | | | + | | | [:serve "Marco Belinelli"->"Spurs"@1] | | [:serve "LeBron James"->"Cavaliers"@0] | | [:serve "Dwyane Wade"->"Heat"@1] | | | | | + | | | [:like "Danny Green"->"Marco Belinelli"@0] | | [:serve "LeBron James"->"Heat"@0] | | [:like "Dirk Nowitzki"->"Dwyane Wade"@0] | | | | | + | | | [:like "Dejounte Murray"->"Marco Belinelli"@0] | | [:serve "LeBron James"->"Lakers"@0] | | [:serve "Kyrie Irving"->"Cavaliers"@0] | | | | | + | | | [:like "Marco Belinelli"->"Danny Green"@0] | | [:serve "LeBron James"->"Cavaliers"@1] | | [:serve "Kyrie Irving"->"Celtics"@0] | | | | | + | | | [:serve "Dejounte Murray"->"Spurs"@0] | | [:like "Carmelo Anthony"->"LeBron James"@0] | | | | | | | + | | | [:like "Dejounte Murray"->"Chris Paul"@0] | | [:like "Chris Paul"->"LeBron James"@0] | | | | | | | + | | | [:like "Dejounte Murray"->"Danny Green"@0] | | [:like "Dwyane Wade"->"LeBron James"@0] | | | | | | | + | | | [:like "Dejounte Murray"->"James Harden"@0] | | [:like "Kyrie Irving"->"LeBron James"@0] | | | | | | | + | | | [:like "Dejounte Murray"->"Kevin Durant"@0] | | [:like "LeBron James"->"Ray Allen"@0] | | | | | | | + | | | [:like "Dejounte Murray"->"Kyle Anderson"@0] | | [:serve "Chris Paul"->"Clippers"@0] | | | | | | | + | | | [:like "Dejounte Murray"->"LeBron James"@0] | | [:serve "Chris Paul"->"Hornets"@0] | | | | | | | + | | | [:like "Dejounte Murray"->"Russell Westbrook"@0] | | [:serve "Chris Paul"->"Rockets"@0] | | | | | | | + | | | | | [:like "Blake Griffin"->"Chris Paul"@0] | | | | | | | + | | | | | [:like "Carmelo Anthony"->"Chris Paul"@0] | | | | | | | + | | | | | [:like "Dwyane Wade"->"Chris Paul"@0] | | | | | | | + | | | | | [:like "Chris Paul"->"Carmelo Anthony"@0] | | | | | | | + | | | | | [:like "Chris Paul"->"Dwyane Wade"@0] | | | | | | | + Then the result should be, in any order, with relax comparison: + | nodes | relationships | + | [("Tony Parker")] | <[edge1]> | + | <[vertex2]> | <[edge2]> | + | <[vertex3]> | <[edge3]> | + | <[vertex4]> | <[edge4]> | + | <[vertex5]> | <[edge5]> | + | <[vertex6]> | <[edge6]> | + When executing query: + """ + GET SUBGRAPH WITH PROP 4 steps from 'Tim Duncan' BOTH like YIELD VERTICES as nodes, EDGES as relationships + """ + Then define some list variables: + | edge1 | vertex2 | edge2 | vertex3 | edge3 | vertex4 | edge4 | vertex5 | + | [:like "Aron Baynes"->"Tim Duncan"@0] | ("LaMarcus Aldridge") | [:like "Damian Lillard"->"LaMarcus Aldridge"@0] | ("Kevin Durant") | [:like "Luka Doncic"->"James Harden"@0] | ("Tracy McGrady") | [:like "Grant Hill"->"Tracy McGrady"@0] | ("Kobe Bryant") | + | [:like "Boris Diaw"->"Tim Duncan"@0] | ("Boris Diaw") | [:like "Rudy Gay"->"LaMarcus Aldridge"@0] | ("James Harden") | [:like "Russell Westbrook"->"James Harden"@0] | ("Carmelo Anthony") | [:like "Vince Carter"->"Tracy McGrady"@0] | ("Dirk Nowitzki") | + | [:like "Danny Green"->"Tim Duncan"@0] | ("Dejounte Murray") | [:like "Tony Parker"->"LaMarcus Aldridge"@0] | ("Chris Paul") | [:like "James Harden"->"Russell Westbrook"@0] | ("Luka Doncic") | [:like "Tracy McGrady"->"Grant Hill"@0] | ("Grant Hill") | + | [:like "Dejounte Murray"->"Tim Duncan"@0] | ("Danny Green") | [:like "LaMarcus Aldridge"->"Tony Parker"@0] | ("Damian Lillard") | [:like "Blake Griffin"->"Chris Paul"@0] | ("Blake Griffin") | [:like "Tracy McGrady"->"Kobe Bryant"@0] | ("Vince Carter") | + | [:like "LaMarcus Aldridge"->"Tim Duncan"@0] | ("Marco Belinelli") | [:like "Boris Diaw"->"Tony Parker"@0] | ("Rudy Gay") | [:like "Carmelo Anthony"->"Chris Paul"@0] | ("Dwyane Wade") | [:like "Dwyane Wade"->"Carmelo Anthony"@0] | ("Rajon Rondo") | + | [:like "Manu Ginobili"->"Tim Duncan"@0] | ("Aron Baynes") | [:like "Dejounte Murray"->"Chris Paul"@0] | ("Kyle Anderson") | [:like "Dwyane Wade"->"Chris Paul"@0] | ("Kyrie Irving") | [:like "Carmelo Anthony"->"Dwyane Wade"@0] | ("Kristaps Porzingis") | + | [:like "Marco Belinelli"->"Tim Duncan"@0] | ("Manu Ginobili") | [:like "Dejounte Murray"->"Danny Green"@0] | ("LeBron James") | [:like "Chris Paul"->"Carmelo Anthony"@0] | ("Ray Allen") | [:like "Kristaps Porzingis"->"Luka Doncic"@0] | | + | [:like "Shaquile O'Neal"->"Tim Duncan"@0] | ("Tiago Splitter") | [:like "Dejounte Murray"->"James Harden"@0] | ("Russell Westbrook") | [:like "Chris Paul"->"Dwyane Wade"@0] | ("Paul George") | [:like "Luka Doncic"->"Dirk Nowitzki"@0] | | + | [:like "Tiago Splitter"->"Tim Duncan"@0] | ("Shaquile O'Neal") | [:like "Dejounte Murray"->"Kevin Durant"@0] | ("Yao Ming") | [:like "Chris Paul"->"LeBron James"@0] | | [:like "Luka Doncic"->"Kristaps Porzingis"@0] | | + | [:like "Tony Parker"->"Tim Duncan"@0] | ("Tony Parker") | [:like "Dejounte Murray"->"Kyle Anderson"@0] | ("JaVale McGee") | [:like "Tracy McGrady"->"Rudy Gay"@0] | | [:like "Dirk Nowitzki"->"Dwyane Wade"@0] | | + | [:like "Tim Duncan"->"Manu Ginobili"@0] | | [:like "Dejounte Murray"->"LeBron James"@0] | | [:like "Carmelo Anthony"->"LeBron James"@0] | | [:like "Rajon Rondo"->"Ray Allen"@0] | | + | [:like "Tim Duncan"->"Tony Parker"@0] | | [:like "Dejounte Murray"->"Manu Ginobili"@0] | | [:like "Dwyane Wade"->"LeBron James"@0] | | [:like "Ray Allen"->"Rajon Rondo"@0] | | + | | | [:like "Dejounte Murray"->"Marco Belinelli"@0] | | [:like "Kyrie Irving"->"LeBron James"@0] | | | | + | | | [:like "Dejounte Murray"->"Russell Westbrook"@0] | | [:like "LeBron James"->"Ray Allen"@0] | | | | + | | | [:like "Dejounte Murray"->"Tony Parker"@0] | | [:like "Paul George"->"Russell Westbrook"@0] | | | | + | | | [:like "Marco Belinelli"->"Danny Green"@0] | | [:like "Russell Westbrook"->"Paul George"@0] | | | | + | | | [:like "Danny Green"->"LeBron James"@0] | | [:like "Yao Ming"->"Tracy McGrady"@0] | | | | + | | | [:like "Danny Green"->"Marco Belinelli"@0] | | | | | | + | | | [:like "Marco Belinelli"->"Tony Parker"@0] | | | | | | + | | | [:like "Tiago Splitter"->"Manu Ginobili"@0] | | | | | | + | | | [:like "Tony Parker"->"Manu Ginobili"@0] | | | | | | + | | | [: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: + | nodes | relationships | + | [("Tim Duncan")] | <[edge1]> | + | <[vertex2]> | <[edge2]> | + | <[vertex3]> | <[edge3]> | + | <[vertex4]> | <[edge4]> | + | <[vertex5]> | [] | + + Scenario: yield over end + When executing query: + """ + GET SUBGRAPH WITH PROP 10000000000000 STEPS FROM 'Yao Ming' IN teammate OUT serve YIELD VERTICES as nodes, EDGES as relationships + """ + Then the result should be, in any order, with relax comparison: + | nodes | relationships | + | [("Yao Ming")] | [[:serve "Yao Ming"->"Rockets"@0]] | + | [("Rockets")] | [] | + When executing query: + """ + GET SUBGRAPH 10000000000000 STEPS FROM 'Yao Ming' IN teammate OUT serve YIELD VERTICES as nodes, EDGES as relationships + """ + Then the result should be, in any order, with relax comparison: + | nodes | relationships | + | [("Yao Ming")] | [[:serve "Yao Ming"->"Rockets"@0]] | + | [("Rockets")] | [] | + + Scenario: yield many steps without prop + When executing query: + """ + GET SUBGRAPH 4 STEPS FROM 'Yao Ming' IN teammate OUT serve YIELD VERTICES as nodes, EDGES as relationships + """ + Then the result should be, in any order, with relax comparison: + | nodes | relationships | + | [("Yao Ming")] | [[:serve "Yao Ming"->"Rockets"@0]] | + | [("Rockets")] | [] | + When executing query: + """ + GET SUBGRAPH 4 STEPS FROM 'NOBODY' IN teammate OUT serve YIELD VERTICES as nodes, EDGES as relationships + """ + Then the result should be, in any order, with relax comparison: + | nodes | relationships | + | [("NOBODY")] | [] | + When executing query: + """ + GET SUBGRAPH 4 steps from 'Yao Ming' IN teammate OUT serve BOTH like YIELD vertices as nodes, edges as relationships + """ + Then define some list variables: + | edge1 | vertex2 | edge2 | vertex3 | edge3 | vertex4 | edge4 | vertex5 | edge5 | + | [:serve "Yao Ming"->"Rockets"@0] | ("Shaquile O'Neal") | [:serve "Shaquile O'Neal"->"Cavaliers"@0] | ("Kobe Bryant") | [:serve "Kobe Bryant"->"Lakers"@0] | ("Manu Ginobili") | [:serve "Manu Ginobili"->"Spurs"@0] | ("Dirk Nowitzki") | [:like "Dirk Nowitzki"->"Steve Nash"@0] | + | [:like "Yao Ming"->"Shaquile O'Neal"@0] | ("Tracy McGrady") | [:serve "Shaquile O'Neal"->"Celtics"@0] | ("Grant Hill") | [:like "Paul Gasol"->"Kobe Bryant"@0] | ("Paul Gasol") | [:teammate "Tim Duncan"->"Manu Ginobili"@0] | ("Kevin Durant") | [:serve "Kevin Durant"->"Warriors"@0] | + | [:like "Yao Ming"->"Tracy McGrady"@0] | ("Rockets") | [:serve "Shaquile O'Neal"->"Heat"@0] | ("Vince Carter") | [:serve "Grant Hill"->"Clippers"@0] | ("Jason Kidd") | [:teammate "Tony Parker"->"Manu Ginobili"@0] | ("Damian Lillard") | [:serve "Damian Lillard"->"Trail Blazers"@0] | + | | | [:serve "Shaquile O'Neal"->"Lakers"@0] | ("Tim Duncan") | [:serve "Grant Hill"->"Magic"@0] | ("Tony Parker") | [:like "Dejounte Murray"->"Manu Ginobili"@0] | ("James Harden") | [:serve "James Harden"->"Rockets"@0] | + | | | [:serve "Shaquile O'Neal"->"Magic"@0] | ("JaVale McGee") | [:serve "Grant Hill"->"Pistons"@0] | ("Marco Belinelli") | [:like "Tiago Splitter"->"Manu Ginobili"@0] | ("Chris Paul") | [:like "Steve Nash"->"Dirk Nowitzki"@0] | + | | | [:serve "Shaquile O'Neal"->"Suns"@0] | ("Rudy Gay") | [:serve "Grant Hill"->"Suns"@0] | ("Dejounte Murray") | [:like "Tony Parker"->"Manu Ginobili"@0] | ("LeBron James") | [:like "Russell Westbrook"->"James Harden"@0] | + | | | [:like "Shaquile O'Neal"->"JaVale McGee"@0] | ("Magic") | [:serve "Vince Carter"->"Grizzlies"@0] | ("Aron Baynes") | [:serve "Paul Gasol"->"Bucks"@0] | ("Steve Nash") | [:like "James Harden"->"Russell Westbrook"@0] | + | | | [:like "Shaquile O'Neal"->"Tim Duncan"@0] | ("Spurs") | [:serve "Vince Carter"->"Hawks"@0] | ("Boris Diaw") | [:serve "Paul Gasol"->"Bulls"@0] | ("Marc Gasol") | [:serve "Chris Paul"->"Clippers"@0] | + | | | [:serve "Tracy McGrady"->"Magic"@0] | ("Celtics") | [:serve "Vince Carter"->"Kings"@0] | ("Danny Green") | [:serve "Paul Gasol"->"Grizzlies"@0] | ("Kyle Anderson") | [:serve "Chris Paul"->"Hornets"@0] | + | | | [:serve "Tracy McGrady"->"Raptors"@0] | ("Heat") | [:serve "Vince Carter"->"Magic"@0] | ("LaMarcus Aldridge") | [:serve "Paul Gasol"->"Lakers"@0] | ("Russell Westbrook") | [:serve "Chris Paul"->"Rockets"@0] | + | | | [:serve "Tracy McGrady"->"Rockets"@0] | ("Suns") | [:serve "Vince Carter"->"Mavericks"@0] | ("Tiago Splitter") | [:serve "Paul Gasol"->"Spurs"@0] | ("76ers") | [:serve "Dirk Nowitzki"->"Mavericks"@0] | + | | | [:serve "Tracy McGrady"->"Spurs"@0] | ("Lakers") | [:serve "Vince Carter"->"Nets"@0] | ("Pistons") | [:like "Marc Gasol"->"Paul Gasol"@0] | ("Hornets") | [:like "Chris Paul"->"LeBron James"@0] | + | | | [:like "Grant Hill"->"Tracy McGrady"@0] | ("Cavaliers") | [:serve "Vince Carter"->"Raptors"@0] | ("Nets") | [:like "Paul Gasol"->"Marc Gasol"@0] | ("Bucks") | [:serve "Steve Nash"->"Lakers"@0] | + | | | [:like "Vince Carter"->"Tracy McGrady"@0] | ("Raptors") | [:serve "Vince Carter"->"Suns"@0] | ("Kings") | [:serve "Jason Kidd"->"Knicks"@0] | ("Knicks") | [:serve "Steve Nash"->"Mavericks"@0] | + | | | [:like "Tracy McGrady"->"Grant Hill"@0] | | [:like "Jason Kidd"->"Vince Carter"@0] | ("Clippers") | [:serve "Jason Kidd"->"Mavericks"@0] | ("Bulls") | [:serve "Steve Nash"->"Suns"@0] | + | | | [:like "Tracy McGrady"->"Kobe Bryant"@0] | | [:like "Vince Carter"->"Jason Kidd"@0] | ("Mavericks") | [:serve "Jason Kidd"->"Nets"@0] | ("Trail Blazers") | [:serve "Steve Nash"->"Suns"@1] | + | | | [:like "Tracy McGrady"->"Rudy Gay"@0] | | [:serve "Tim Duncan"->"Spurs"@0] | ("Hawks") | [:serve "Jason Kidd"->"Suns"@0] | ("Jazz") | [:serve "LeBron James"->"Cavaliers"@1] | + | | | | | [:teammate "Manu Ginobili"->"Tim Duncan"@0] | ("Warriors") | [:serve "Jason Kidd"->"Mavericks"@1] | | [:serve "LeBron James"->"Lakers"@0] | + | | | | | [:teammate "Tony Parker"->"Tim Duncan"@0] | ("Nuggets") | [:like "Dirk Nowitzki"->"Jason Kidd"@0] | | [:serve "LeBron James"->"Heat"@0] | + | | | | | [:like "Aron Baynes"->"Tim Duncan"@0] | ("Grizzlies") | [:like "Steve Nash"->"Jason Kidd"@0] | | [:serve "Marc Gasol"->"Grizzlies"@0] | + | | | | | [:like "Boris Diaw"->"Tim Duncan"@0] | ("Wizards") | [:like "Jason Kidd"->"Dirk Nowitzki"@0] | | [:serve "Marc Gasol"->"Raptors"@0] | + | | | | | [:like "Danny Green"->"Tim Duncan"@0] | | [:like "Jason Kidd"->"Steve Nash"@0] | | [:serve "Kyle Anderson"->"Grizzlies"@0] | + | | | | | [:like "Dejounte Murray"->"Tim Duncan"@0] | | [:serve "Tony Parker"->"Hornets"@0] | | [:serve "Kyle Anderson"->"Spurs"@0] | + | | | | | [:like "LaMarcus Aldridge"->"Tim Duncan"@0] | | [:serve "Tony Parker"->"Spurs"@0] | | [:teammate "Tony Parker"->"Kyle Anderson"@0] | + | | | | | [:like "Manu Ginobili"->"Tim Duncan"@0] | | [:teammate "Manu Ginobili"->"Tony Parker"@0] | | [:serve "LeBron James"->"Cavaliers"@0] | + | | | | | [:like "Marco Belinelli"->"Tim Duncan"@0] | | [:teammate "Tim Duncan"->"Tony Parker"@0] | | | + | | | | | [:like "Tiago Splitter"->"Tim Duncan"@0] | | [:like "Boris Diaw"->"Tony Parker"@0] | | | + | | | | | [:like "Tony Parker"->"Tim Duncan"@0] | | [:like "Dejounte Murray"->"Tony Parker"@0] | | | + | | | | | [:like "Tim Duncan"->"Manu Ginobili"@0] | | [:like "LaMarcus Aldridge"->"Tony Parker"@0] | | | + | | | | | [:like "Tim Duncan"->"Tony Parker"@0] | | [:like "Marco Belinelli"->"Tony Parker"@0] | | | + | | | | | [:serve "JaVale McGee"->"Lakers"@0] | | [:like "Tony Parker"->"LaMarcus Aldridge"@0] | | | + | | | | | [:serve "JaVale McGee"->"Mavericks"@0] | | [:serve "Marco Belinelli"->"76ers"@0] | | | + | | | | | [:serve "JaVale McGee"->"Nuggets"@0] | | [:serve "Marco Belinelli"->"Bulls"@0] | | | + | | | | | [:serve "JaVale McGee"->"Warriors"@0] | | [:serve "Marco Belinelli"->"Hawks"@0] | | | + | | | | | [:serve "JaVale McGee"->"Wizards"@0] | | [:serve "Marco Belinelli"->"Hornets"@0] | | | + | | | | | [:serve "Rudy Gay"->"Grizzlies"@0] | | [:serve "Marco Belinelli"->"Kings"@0] | | | + | | | | | [:serve "Rudy Gay"->"Kings"@0] | | [:serve "Marco Belinelli"->"Raptors"@0] | | | + | | | | | [:serve "Rudy Gay"->"Raptors"@0] | | [:serve "Marco Belinelli"->"Spurs"@0] | | | + | | | | | [:serve "Rudy Gay"->"Spurs"@0] | | [:serve "Marco Belinelli"->"Warriors"@0] | | | + | | | | | [:like "Rudy Gay"->"LaMarcus Aldridge"@0] | | [:serve "Marco Belinelli"->"Hornets"@1] | | | + | | | | | | | [:serve "Marco Belinelli"->"Spurs"@1] | | | + | | | | | | | [:like "Danny Green"->"Marco Belinelli"@0] | | | + | | | | | | | [:like "Dejounte Murray"->"Marco Belinelli"@0] | | | + | | | | | | | [:like "Marco Belinelli"->"Danny Green"@0] | | | + | | | | | | | [:serve "Dejounte Murray"->"Spurs"@0] | | | + | | | | | | | [:like "Dejounte Murray"->"Chris Paul"@0] | | | + | | | | | | | [:like "Dejounte Murray"->"Danny Green"@0] | | | + | | | | | | | [:like "Dejounte Murray"->"James Harden"@0] | | | + | | | | | | | [:like "Dejounte Murray"->"Kevin Durant"@0] | | | + | | | | | | | [:like "Dejounte Murray"->"Kyle Anderson"@0] | | | + | | | | | | | [:like "Dejounte Murray"->"LeBron James"@0] | | | + | | | | | | | [:like "Dejounte Murray"->"Russell Westbrook"@0] | | | + | | | | | | | [:serve "Aron Baynes"->"Celtics"@0] | | | + | | | | | | | [:serve "Aron Baynes"->"Pistons"@0] | | | + | | | | | | | [:serve "Aron Baynes"->"Spurs"@0] | | | + | | | | | | | [:serve "Boris Diaw"->"Hawks"@0] | | | + | | | | | | | [:serve "Boris Diaw"->"Hornets"@0] | | | + | | | | | | | [:serve "Boris Diaw"->"Jazz"@0] | | | + | | | | | | | [:serve "Boris Diaw"->"Spurs"@0] | | | + | | | | | | | [:serve "Boris Diaw"->"Suns"@0] | | | + | | | | | | | [:serve "Danny Green"->"Cavaliers"@0] | | | + | | | | | | | [:serve "Danny Green"->"Raptors"@0] | | | + | | | | | | | [:serve "Danny Green"->"Spurs"@0] | | | + | | | | | | | [:teammate "Tim Duncan"->"Danny Green"@0] | | | + | | | | | | | [:like "Danny Green"->"LeBron James"@0] | | | + | | | | | | | [:serve "LaMarcus Aldridge"->"Spurs"@0] | | | + | | | | | | | [:serve "LaMarcus Aldridge"->"Trail Blazers"@0] | | | + | | | | | | | [:teammate "Tim Duncan"->"LaMarcus Aldridge"@0] | | | + | | | | | | | [:teammate "Tony Parker"->"LaMarcus Aldridge"@0] | | | + | | | | | | | [:like "Damian Lillard"->"LaMarcus Aldridge"@0] | | | + | | | | | | | [:serve "Tiago Splitter"->"76ers"@0] | | | + | | | | | | | [:serve "Tiago Splitter"->"Hawks"@0] | | | + | | | | | | | [:serve "Tiago Splitter"->"Spurs"@0] | | | + Then the result should be, in any order, with relax comparison: + | nodes | relationships | + | [("Yao Ming")] | <[edge1]> | + | <[vertex2]> | <[edge2]> | + | <[vertex3]> | <[edge3]> | + | <[vertex4]> | <[edge4]> | + | <[vertex5]> | <[edge5]> | + When executing query: + """ + GET SUBGRAPH 5 steps from 'Tony Parker' IN teammate OUT serve BOTH like YIELD vertices as nodes, edges as relationships + """ + Then define some list variables: + | edge1 | vertex2 | edge2 | vertex3 | edge3 | vertex4 | edge4 | vertex5 | edge5 | vertex6 | edge6 | + | [:serve "Tony Parker"->"Hornets"@0] | ("Tim Duncan") | [:serve "Tim Duncan"->"Spurs"@0] | ("Aron Baynes") | [:serve "Aron Baynes"->"Celtics"@0] | ("Yao Ming") | [:serve "Yao Ming"->"Rockets"@0] | ("Grant Hill") | [:serve "Grant Hill"->"Clippers"@0] | ("Steve Nash") | [:serve "Steve Nash"->"Lakers"@0] | + | [:serve "Tony Parker"->"Spurs"@0] | ("Boris Diaw") | [:teammate "Manu Ginobili"->"Tim Duncan"@0] | ("Rudy Gay") | [:serve "Aron Baynes"->"Pistons"@0] | ("Ray Allen") | [:like "Yao Ming"->"Tracy McGrady"@0] | ("Kristaps Porzingis") | [:serve "Grant Hill"->"Magic"@0] | ("Paul Gasol") | [:serve "Steve Nash"->"Mavericks"@0] | + | [:teammate "Manu Ginobili"->"Tony Parker"@0] | ("LaMarcus Aldridge") | [:teammate "Tony Parker"->"Tim Duncan"@0] | ("Damian Lillard") | [:serve "Aron Baynes"->"Spurs"@0] | ("Blake Griffin") | [:serve "Ray Allen"->"Bucks"@0] | ("Dirk Nowitzki") | [:serve "Grant Hill"->"Pistons"@0] | ("Jason Kidd") | [:serve "Steve Nash"->"Suns"@0] | + | [:teammate "Tim Duncan"->"Tony Parker"@0] | ("Manu Ginobili") | [:like "Aron Baynes"->"Tim Duncan"@0] | ("Kevin Durant") | [:serve "Rudy Gay"->"Grizzlies"@0] | ("Paul George") | [:serve "Ray Allen"->"Celtics"@0] | ("Rajon Rondo") | [:serve "Grant Hill"->"Suns"@0] | ("Pelicans") | [:serve "Steve Nash"->"Suns"@1] | + | [:like "Boris Diaw"->"Tony Parker"@0] | ("Marco Belinelli") | [:like "Boris Diaw"->"Tim Duncan"@0] | ("Shaquile O'Neal") | [:serve "Rudy Gay"->"Kings"@0] | ("JaVale McGee") | [:serve "Ray Allen"->"Heat"@0] | ("Vince Carter") | [:serve "Kristaps Porzingis"->"Knicks"@0] | ("Nets") | [:like "Jason Kidd"->"Steve Nash"@0] | + | [:like "Dejounte Murray"->"Tony Parker"@0] | ("Dejounte Murray") | [:like "Danny Green"->"Tim Duncan"@0] | ("Tiago Splitter") | [:serve "Rudy Gay"->"Raptors"@0] | ("Luka Doncic") | [:serve "Ray Allen"->"Thunders"@0] | ("Kobe Bryant") | [:serve "Kristaps Porzingis"->"Mavericks"@0] | | [:serve "Paul Gasol"->"Spurs"@0] | + | [:like "LaMarcus Aldridge"->"Tony Parker"@0] | ("Hornets") | [:like "Dejounte Murray"->"Tim Duncan"@0] | ("Russell Westbrook") | [:serve "Rudy Gay"->"Spurs"@0] | ("Carmelo Anthony") | [:like "Rajon Rondo"->"Ray Allen"@0] | ("Wizards") | [:serve "Dirk Nowitzki"->"Mavericks"@0] | | [:like "Steve Nash"->"Jason Kidd"@0] | + | [:like "Marco Belinelli"->"Tony Parker"@0] | ("Spurs") | [:like "LaMarcus Aldridge"->"Tim Duncan"@0] | ("Danny Green") | [:like "Tracy McGrady"->"Rudy Gay"@0] | ("Tracy McGrady") | [:like "Ray Allen"->"Rajon Rondo"@0] | ("Pacers") | [:like "Jason Kidd"->"Dirk Nowitzki"@0] | | [:serve "Paul Gasol"->"Lakers"@0] | + | [:like "Tim Duncan"->"Tony Parker"@0] | | [:like "Manu Ginobili"->"Tim Duncan"@0] | ("Kyle Anderson") | [:serve "Damian Lillard"->"Trail Blazers"@0] | ("Dwyane Wade") | [:serve "Blake Griffin"->"Clippers"@0] | ("Knicks") | [:like "Steve Nash"->"Dirk Nowitzki"@0] | | [:serve "Jason Kidd"->"Knicks"@0] | + | [:like "Tony Parker"->"LaMarcus Aldridge"@0] | | [:like "Marco Belinelli"->"Tim Duncan"@0] | ("James Harden") | [:serve "Kevin Durant"->"Thunders"@0] | ("Kyrie Irving") | [:serve "Blake Griffin"->"Pistons"@0] | ("Bucks") | [:like "Dirk Nowitzki"->"Jason Kidd"@0] | | [:serve "Jason Kidd"->"Mavericks"@0] | + | [:like "Tony Parker"->"Manu Ginobili"@0] | | [:like "Shaquile O'Neal"->"Tim Duncan"@0] | ("LeBron James") | [:serve "Kevin Durant"->"Warriors"@0] | ("Cavaliers") | [:serve "Paul George"->"Pacers"@0] | ("Mavericks") | [:like "Dirk Nowitzki"->"Steve Nash"@0] | | [:serve "Jason Kidd"->"Nets"@0] | + | [:like "Tony Parker"->"Tim Duncan"@0] | | [:like "Tiago Splitter"->"Tim Duncan"@0] | ("Chris Paul") | [:serve "Shaquile O'Neal"->"Cavaliers"@0] | ("Celtics") | [:serve "Paul George"->"Thunders"@0] | ("Nuggets") | [:serve "Rajon Rondo"->"Bulls"@0] | | [:serve "Jason Kidd"->"Suns"@0] | + | | | [:like "Tim Duncan"->"Manu Ginobili"@0] | ("Bulls") | [:serve "Shaquile O'Neal"->"Celtics"@0] | ("Pistons") | [:serve "JaVale McGee"->"Lakers"@0] | | [:serve "Rajon Rondo"->"Celtics"@0] | | [:serve "Jason Kidd"->"Mavericks"@1] | + | | | [:serve "Boris Diaw"->"Hawks"@0] | ("Jazz") | [:serve "Shaquile O'Neal"->"Heat"@0] | ("Grizzlies") | [:serve "JaVale McGee"->"Mavericks"@0] | | [:serve "Rajon Rondo"->"Kings"@0] | | [:serve "Paul Gasol"->"Bucks"@0] | + | | | [:serve "Boris Diaw"->"Hornets"@0] | ("Hawks") | [:serve "Shaquile O'Neal"->"Lakers"@0] | ("Heat") | [:serve "JaVale McGee"->"Nuggets"@0] | | [:serve "Rajon Rondo"->"Lakers"@0] | | [:serve "Paul Gasol"->"Bulls"@0] | + | | | [:serve "Boris Diaw"->"Jazz"@0] | ("Warriors") | [:serve "Shaquile O'Neal"->"Magic"@0] | ("Magic") | [:serve "JaVale McGee"->"Warriors"@0] | | [:serve "Rajon Rondo"->"Mavericks"@0] | | [:serve "Paul Gasol"->"Grizzlies"@0] | + | | | [:serve "Boris Diaw"->"Spurs"@0] | ("Suns") | [:serve "Shaquile O'Neal"->"Suns"@0] | ("Lakers") | [:serve "JaVale McGee"->"Wizards"@0] | | [:serve "Rajon Rondo"->"Pelicans"@0] | | | + | | | [:serve "Boris Diaw"->"Suns"@0] | ("Trail Blazers") | [:like "Yao Ming"->"Shaquile O'Neal"@0] | ("Clippers") | [:serve "Luka Doncic"->"Mavericks"@0] | | [:serve "Vince Carter"->"Grizzlies"@0] | | | + | | | [:serve "LaMarcus Aldridge"->"Spurs"@0] | ("Kings") | [:like "Shaquile O'Neal"->"JaVale McGee"@0] | ("Thunders") | [:like "Kristaps Porzingis"->"Luka Doncic"@0] | | [:serve "Vince Carter"->"Hawks"@0] | | | + | | | [:serve "LaMarcus Aldridge"->"Trail Blazers"@0] | ("Raptors") | [:serve "Tiago Splitter"->"76ers"@0] | ("Rockets") | [:like "Luka Doncic"->"Dirk Nowitzki"@0] | | [:serve "Vince Carter"->"Kings"@0] | | | + | | | [:teammate "Tim Duncan"->"LaMarcus Aldridge"@0] | ("76ers") | [:serve "Tiago Splitter"->"Hawks"@0] | | [:like "Luka Doncic"->"Kristaps Porzingis"@0] | | [:serve "Vince Carter"->"Magic"@0] | | | + | | | [:teammate "Tony Parker"->"LaMarcus Aldridge"@0] | | [:serve "Tiago Splitter"->"Spurs"@0] | | [:serve "Carmelo Anthony"->"Knicks"@0] | | [:serve "Vince Carter"->"Mavericks"@0] | | | + | | | [:like "Damian Lillard"->"LaMarcus Aldridge"@0] | | [:serve "Russell Westbrook"->"Thunders"@0] | | [:serve "Carmelo Anthony"->"Nuggets"@0] | | [:serve "Vince Carter"->"Nets"@0] | | | + | | | [:like "Rudy Gay"->"LaMarcus Aldridge"@0] | | [:like "James Harden"->"Russell Westbrook"@0] | | [:serve "Carmelo Anthony"->"Rockets"@0] | | [:serve "Vince Carter"->"Raptors"@0] | | | + | | | [:serve "Manu Ginobili"->"Spurs"@0] | | [:like "Paul George"->"Russell Westbrook"@0] | | [:serve "Carmelo Anthony"->"Thunders"@0] | | [:serve "Vince Carter"->"Suns"@0] | | | + | | | [:teammate "Tim Duncan"->"Manu Ginobili"@0] | | [:like "Russell Westbrook"->"James Harden"@0] | | [:like "Dwyane Wade"->"Carmelo Anthony"@0] | | [:like "Jason Kidd"->"Vince Carter"@0] | | | + | | | [:teammate "Tony Parker"->"Manu Ginobili"@0] | | [:like "Russell Westbrook"->"Paul George"@0] | | [:like "Carmelo Anthony"->"Dwyane Wade"@0] | | [:like "Vince Carter"->"Jason Kidd"@0] | | | + | | | [:like "Dejounte Murray"->"Manu Ginobili"@0] | | [:serve "Danny Green"->"Cavaliers"@0] | | [:serve "Tracy McGrady"->"Magic"@0] | | [:serve "Kobe Bryant"->"Lakers"@0] | | | + | | | [:like "Tiago Splitter"->"Manu Ginobili"@0] | | [:serve "Danny Green"->"Raptors"@0] | | [:serve "Tracy McGrady"->"Raptors"@0] | | [:like "Paul Gasol"->"Kobe Bryant"@0] | | | + | | | [:serve "Marco Belinelli"->"76ers"@0] | | [:serve "Danny Green"->"Spurs"@0] | | [:serve "Tracy McGrady"->"Rockets"@0] | | | | | + | | | [:serve "Marco Belinelli"->"Bulls"@0] | | [:teammate "Tim Duncan"->"Danny Green"@0] | | [:serve "Tracy McGrady"->"Spurs"@0] | | | | | + | | | [:serve "Marco Belinelli"->"Hawks"@0] | | [:like "Danny Green"->"LeBron James"@0] | | [:like "Grant Hill"->"Tracy McGrady"@0] | | | | | + | | | [:serve "Marco Belinelli"->"Hornets"@0] | | [:serve "Kyle Anderson"->"Grizzlies"@0] | | [:like "Vince Carter"->"Tracy McGrady"@0] | | | | | + | | | [:serve "Marco Belinelli"->"Kings"@0] | | [:serve "Kyle Anderson"->"Spurs"@0] | | [:like "Tracy McGrady"->"Grant Hill"@0] | | | | | + | | | [:serve "Marco Belinelli"->"Raptors"@0] | | [:teammate "Tony Parker"->"Kyle Anderson"@0] | | [:like "Tracy McGrady"->"Kobe Bryant"@0] | | | | | + | | | [:serve "Marco Belinelli"->"Spurs"@0] | | [:serve "James Harden"->"Rockets"@0] | | [:serve "Dwyane Wade"->"Bulls"@0] | | | | | + | | | [:serve "Marco Belinelli"->"Warriors"@0] | | [:serve "James Harden"->"Thunders"@0] | | [:serve "Dwyane Wade"->"Cavaliers"@0] | | | | | + | | | [:serve "Marco Belinelli"->"Hornets"@1] | | [:like "Luka Doncic"->"James Harden"@0] | | [:serve "Dwyane Wade"->"Heat"@0] | | | | | + | | | [:serve "Marco Belinelli"->"Spurs"@1] | | [:serve "LeBron James"->"Cavaliers"@0] | | [:serve "Dwyane Wade"->"Heat"@1] | | | | | + | | | [:like "Danny Green"->"Marco Belinelli"@0] | | [:serve "LeBron James"->"Heat"@0] | | [:like "Dirk Nowitzki"->"Dwyane Wade"@0] | | | | | + | | | [:like "Dejounte Murray"->"Marco Belinelli"@0] | | [:serve "LeBron James"->"Lakers"@0] | | [:serve "Kyrie Irving"->"Cavaliers"@0] | | | | | + | | | [:like "Marco Belinelli"->"Danny Green"@0] | | [:serve "LeBron James"->"Cavaliers"@1] | | [:serve "Kyrie Irving"->"Celtics"@0] | | | | | + | | | [:serve "Dejounte Murray"->"Spurs"@0] | | [:like "Carmelo Anthony"->"LeBron James"@0] | | | | | | | + | | | [:like "Dejounte Murray"->"Chris Paul"@0] | | [:like "Chris Paul"->"LeBron James"@0] | | | | | | | + | | | [:like "Dejounte Murray"->"Danny Green"@0] | | [:like "Dwyane Wade"->"LeBron James"@0] | | | | | | | + | | | [:like "Dejounte Murray"->"James Harden"@0] | | [:like "Kyrie Irving"->"LeBron James"@0] | | | | | | | + | | | [:like "Dejounte Murray"->"Kevin Durant"@0] | | [:like "LeBron James"->"Ray Allen"@0] | | | | | | | + | | | [:like "Dejounte Murray"->"Kyle Anderson"@0] | | [:serve "Chris Paul"->"Clippers"@0] | | | | | | | + | | | [:like "Dejounte Murray"->"LeBron James"@0] | | [:serve "Chris Paul"->"Hornets"@0] | | | | | | | + | | | [:like "Dejounte Murray"->"Russell Westbrook"@0] | | [:serve "Chris Paul"->"Rockets"@0] | | | | | | | + | | | | | [:like "Blake Griffin"->"Chris Paul"@0] | | | | | | | + | | | | | [:like "Carmelo Anthony"->"Chris Paul"@0] | | | | | | | + | | | | | [:like "Dwyane Wade"->"Chris Paul"@0] | | | | | | | + | | | | | [:like "Chris Paul"->"Carmelo Anthony"@0] | | | | | | | + | | | | | [:like "Chris Paul"->"Dwyane Wade"@0] | | | | | | | + Then the result should be, in any order, with relax comparison: + | nodes | relationships | + | [("Tony Parker")] | <[edge1]> | + | <[vertex2]> | <[edge2]> | + | <[vertex3]> | <[edge3]> | + | <[vertex4]> | <[edge4]> | + | <[vertex5]> | <[edge5]> | + | <[vertex6]> | <[edge6]> | + When executing query: + """ + GET SUBGRAPH 4 steps from 'Tim Duncan' BOTH like YIELD vertices as nodes, edges as relationships + """ + Then define some list variables: + | edge1 | vertex2 | edge2 | vertex3 | edge3 | vertex4 | edge4 | vertex5 | + | [:like "Aron Baynes"->"Tim Duncan"@0] | ("LaMarcus Aldridge") | [:like "Damian Lillard"->"LaMarcus Aldridge"@0] | ("Kevin Durant") | [:like "Luka Doncic"->"James Harden"@0] | ("Tracy McGrady") | [:like "Grant Hill"->"Tracy McGrady"@0] | ("Kobe Bryant") | + | [:like "Boris Diaw"->"Tim Duncan"@0] | ("Boris Diaw") | [:like "Rudy Gay"->"LaMarcus Aldridge"@0] | ("James Harden") | [:like "Russell Westbrook"->"James Harden"@0] | ("Carmelo Anthony") | [:like "Vince Carter"->"Tracy McGrady"@0] | ("Dirk Nowitzki") | + | [:like "Danny Green"->"Tim Duncan"@0] | ("Dejounte Murray") | [:like "Tony Parker"->"LaMarcus Aldridge"@0] | ("Chris Paul") | [:like "James Harden"->"Russell Westbrook"@0] | ("Luka Doncic") | [:like "Tracy McGrady"->"Grant Hill"@0] | ("Grant Hill") | + | [:like "Dejounte Murray"->"Tim Duncan"@0] | ("Danny Green") | [:like "LaMarcus Aldridge"->"Tony Parker"@0] | ("Damian Lillard") | [:like "Blake Griffin"->"Chris Paul"@0] | ("Blake Griffin") | [:like "Tracy McGrady"->"Kobe Bryant"@0] | ("Vince Carter") | + | [:like "LaMarcus Aldridge"->"Tim Duncan"@0] | ("Marco Belinelli") | [:like "Boris Diaw"->"Tony Parker"@0] | ("Rudy Gay") | [:like "Carmelo Anthony"->"Chris Paul"@0] | ("Dwyane Wade") | [:like "Dwyane Wade"->"Carmelo Anthony"@0] | ("Rajon Rondo") | + | [:like "Manu Ginobili"->"Tim Duncan"@0] | ("Aron Baynes") | [:like "Dejounte Murray"->"Chris Paul"@0] | ("Kyle Anderson") | [:like "Dwyane Wade"->"Chris Paul"@0] | ("Kyrie Irving") | [:like "Carmelo Anthony"->"Dwyane Wade"@0] | ("Kristaps Porzingis") | + | [:like "Marco Belinelli"->"Tim Duncan"@0] | ("Manu Ginobili") | [:like "Dejounte Murray"->"Danny Green"@0] | ("LeBron James") | [:like "Chris Paul"->"Carmelo Anthony"@0] | ("Ray Allen") | [:like "Kristaps Porzingis"->"Luka Doncic"@0] | | + | [:like "Shaquile O'Neal"->"Tim Duncan"@0] | ("Tiago Splitter") | [:like "Dejounte Murray"->"James Harden"@0] | ("Russell Westbrook") | [:like "Chris Paul"->"Dwyane Wade"@0] | ("Paul George") | [:like "Luka Doncic"->"Dirk Nowitzki"@0] | | + | [:like "Tiago Splitter"->"Tim Duncan"@0] | ("Shaquile O'Neal") | [:like "Dejounte Murray"->"Kevin Durant"@0] | ("Yao Ming") | [:like "Chris Paul"->"LeBron James"@0] | | [:like "Luka Doncic"->"Kristaps Porzingis"@0] | | + | [:like "Tony Parker"->"Tim Duncan"@0] | ("Tony Parker") | [:like "Dejounte Murray"->"Kyle Anderson"@0] | ("JaVale McGee") | [:like "Tracy McGrady"->"Rudy Gay"@0] | | [:like "Dirk Nowitzki"->"Dwyane Wade"@0] | | + | [:like "Tim Duncan"->"Manu Ginobili"@0] | | [:like "Dejounte Murray"->"LeBron James"@0] | | [:like "Carmelo Anthony"->"LeBron James"@0] | | [:like "Rajon Rondo"->"Ray Allen"@0] | | + | [:like "Tim Duncan"->"Tony Parker"@0] | | [:like "Dejounte Murray"->"Manu Ginobili"@0] | | [:like "Dwyane Wade"->"LeBron James"@0] | | [:like "Ray Allen"->"Rajon Rondo"@0] | | + | | | [:like "Dejounte Murray"->"Marco Belinelli"@0] | | [:like "Kyrie Irving"->"LeBron James"@0] | | | | + | | | [:like "Dejounte Murray"->"Russell Westbrook"@0] | | [:like "LeBron James"->"Ray Allen"@0] | | | | + | | | [:like "Dejounte Murray"->"Tony Parker"@0] | | [:like "Paul George"->"Russell Westbrook"@0] | | | | + | | | [:like "Marco Belinelli"->"Danny Green"@0] | | [:like "Russell Westbrook"->"Paul George"@0] | | | | + | | | [:like "Danny Green"->"LeBron James"@0] | | [:like "Yao Ming"->"Tracy McGrady"@0] | | | | + | | | [:like "Danny Green"->"Marco Belinelli"@0] | | | | | | + | | | [:like "Marco Belinelli"->"Tony Parker"@0] | | | | | | + | | | [:like "Tiago Splitter"->"Manu Ginobili"@0] | | | | | | + | | | [:like "Tony Parker"->"Manu Ginobili"@0] | | | | | | + | | | [: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: + | nodes | relationships | + | [("Tim Duncan")] | <[edge1]> | + | <[vertex2]> | <[edge2]> | + | <[vertex3]> | <[edge3]> | + | <[vertex4]> | <[edge4]> | + | <[vertex5]> | [] | + + Scenario: subgraph yield vertex edge + When executing query: + """ + GET SUBGRAPH WITH PROP 2 STEPS FROM 'Tim Duncan', 'James Harden' IN teammate OUT serve YIELD vertices as a + """ + Then define some list variables: + | vertex1 | vertex2 | + | ("Tim Duncan") | ("Manu Ginobili") | + | ("James Harden") | ("Tony Parker") | + | | ("Spurs") | + | | ("Rockets") | + | | ("Thunders") | + | | | + | | | + Then the result should be, in any order, with relax comparison: + | a | + | <[vertex1]> | + | <[vertex2]> | + | [("Hornets")] | + When executing query: + """ + GET SUBGRAPH WITH PROP 2 STEPS FROM 'Tim Duncan' IN like, serve YIELD edges as b + """ + Then define some list variables: + | edge1 | edge2 | + | [:like "Aron Baynes"->"Tim Duncan"@0] | [:like "Damian Lillard"->"LaMarcus Aldridge"@0] | + | [:like "Boris Diaw"->"Tim Duncan"@0] | [:like "Rudy Gay"->"LaMarcus Aldridge"@0] | + | [:like "Danny Green"->"Tim Duncan"@0] | [:like "Tony Parker"->"LaMarcus Aldridge"@0] | + | [:like "Dejounte Murray"->"Tim Duncan"@0] | [:like "Dejounte Murray"->"Danny Green"@0] | + | [:like "LaMarcus Aldridge"->"Tim Duncan"@0] | [:like "Marco Belinelli"->"Danny Green"@0] | + | [:like "Manu Ginobili"->"Tim Duncan"@0] | [:like "Danny Green"->"Marco Belinelli"@0] | + | [:like "Marco Belinelli"->"Tim Duncan"@0] | [:like "Dejounte Murray"->"Marco Belinelli"@0] | + | [:like "Shaquile O'Neal"->"Tim Duncan"@0] | [:like "Dejounte Murray"->"Manu Ginobili"@0] | + | [:like "Tiago Splitter"->"Tim Duncan"@0] | [:like "Tiago Splitter"->"Manu Ginobili"@0] | + | [:like "Tony Parker"->"Tim Duncan"@0] | [:like "Tim Duncan"->"Manu Ginobili"@0] | + | | [:like "Tony Parker"->"Manu Ginobili"@0] | + | | [:like "Yao Ming"->"Shaquile O'Neal"@0] | + | | [:like "Boris Diaw"->"Tony Parker"@0] | + | | [:like "Dejounte Murray"->"Tony Parker"@0] | + | | [:like "LaMarcus Aldridge"->"Tony Parker"@0] | + | | [:like "Marco Belinelli"->"Tony Parker"@0] | + | | [:like "Tim Duncan"->"Tony Parker"@0] | + Then the result should be, in any order, with relax comparison: + | b | + | <[edge1]> | + | <[edge2]> | + | [] | + When executing query: + """ + GET SUBGRAPH WITH PROP FROM 'Tony Parker' BOTH like YIELD edges as a, vertices as b + """ + Then define some list variables: + | edge1 | vertex2 | edge2 | + | [:like "Boris Diaw"->"Tony Parker"@0] | ("Manu Ginobili") | [:like "Manu Ginobili"->"Tim Duncan"@0] | + | [:like "Dejounte Murray"->"Tony Parker"@0] | ("Marco Belinelli") | [:like "Dejounte Murray"->"Marco Belinelli"@0] | + | [:like "LaMarcus Aldridge"->"Tony Parker"@0] | ("Tim Duncan") | [:like "Marco Belinelli"->"Tim Duncan"@0] | + | [:like "Marco Belinelli"->"Tony Parker"@0] | ("Dejounte Murray") | [:like "Tim Duncan"->"Manu Ginobili"@0] | + | [:like "Tim Duncan"->"Tony Parker"@0] | ("LaMarcus Aldridge") | [:like "Boris Diaw"->"Tim Duncan"@0] | + | [:like "Tony Parker"->"LaMarcus Aldridge"@0] | ("Boris Diaw") | [:like "Dejounte Murray"->"Manu Ginobili"@0] | + | [: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: + | a | b | + | <[edge1]> | [("Tony Parker")] | + | <[edge2]> | <[vertex2]> | + When executing query: + """ + GET SUBGRAPH 4 steps from 'Tim Duncan' BOTH like YIELD vertices as a, edges as b + """ + Then define some list variables: + | edge1 | vertex2 | edge2 | vertex3 | edge3 | vertex4 | edge4 | vertex5 | + | [:like "Aron Baynes"->"Tim Duncan"@0] | ("LaMarcus Aldridge") | [:like "Damian Lillard"->"LaMarcus Aldridge"@0] | ("Kevin Durant") | [:like "Luka Doncic"->"James Harden"@0] | ("Tracy McGrady") | [:like "Grant Hill"->"Tracy McGrady"@0] | ("Kobe Bryant") | + | [:like "Boris Diaw"->"Tim Duncan"@0] | ("Boris Diaw") | [:like "Rudy Gay"->"LaMarcus Aldridge"@0] | ("James Harden") | [:like "Russell Westbrook"->"James Harden"@0] | ("Carmelo Anthony") | [:like "Vince Carter"->"Tracy McGrady"@0] | ("Dirk Nowitzki") | + | [:like "Danny Green"->"Tim Duncan"@0] | ("Dejounte Murray") | [:like "Tony Parker"->"LaMarcus Aldridge"@0] | ("Chris Paul") | [:like "James Harden"->"Russell Westbrook"@0] | ("Luka Doncic") | [:like "Tracy McGrady"->"Grant Hill"@0] | ("Grant Hill") | + | [:like "Dejounte Murray"->"Tim Duncan"@0] | ("Danny Green") | [:like "LaMarcus Aldridge"->"Tony Parker"@0] | ("Damian Lillard") | [:like "Blake Griffin"->"Chris Paul"@0] | ("Blake Griffin") | [:like "Tracy McGrady"->"Kobe Bryant"@0] | ("Vince Carter") | + | [:like "LaMarcus Aldridge"->"Tim Duncan"@0] | ("Marco Belinelli") | [:like "Boris Diaw"->"Tony Parker"@0] | ("Rudy Gay") | [:like "Carmelo Anthony"->"Chris Paul"@0] | ("Dwyane Wade") | [:like "Dwyane Wade"->"Carmelo Anthony"@0] | ("Rajon Rondo") | + | [:like "Manu Ginobili"->"Tim Duncan"@0] | ("Aron Baynes") | [:like "Dejounte Murray"->"Chris Paul"@0] | ("Kyle Anderson") | [:like "Dwyane Wade"->"Chris Paul"@0] | ("Kyrie Irving") | [:like "Carmelo Anthony"->"Dwyane Wade"@0] | ("Kristaps Porzingis") | + | [:like "Marco Belinelli"->"Tim Duncan"@0] | ("Manu Ginobili") | [:like "Dejounte Murray"->"Danny Green"@0] | ("LeBron James") | [:like "Chris Paul"->"Carmelo Anthony"@0] | ("Ray Allen") | [:like "Kristaps Porzingis"->"Luka Doncic"@0] | | + | [:like "Shaquile O'Neal"->"Tim Duncan"@0] | ("Tiago Splitter") | [:like "Dejounte Murray"->"James Harden"@0] | ("Russell Westbrook") | [:like "Chris Paul"->"Dwyane Wade"@0] | ("Paul George") | [:like "Luka Doncic"->"Dirk Nowitzki"@0] | | + | [:like "Tiago Splitter"->"Tim Duncan"@0] | ("Shaquile O'Neal") | [:like "Dejounte Murray"->"Kevin Durant"@0] | ("Yao Ming") | [:like "Chris Paul"->"LeBron James"@0] | | [:like "Luka Doncic"->"Kristaps Porzingis"@0] | | + | [:like "Tony Parker"->"Tim Duncan"@0] | ("Tony Parker") | [:like "Dejounte Murray"->"Kyle Anderson"@0] | ("JaVale McGee") | [:like "Tracy McGrady"->"Rudy Gay"@0] | | [:like "Dirk Nowitzki"->"Dwyane Wade"@0] | | + | [:like "Tim Duncan"->"Manu Ginobili"@0] | | [:like "Dejounte Murray"->"LeBron James"@0] | | [:like "Carmelo Anthony"->"LeBron James"@0] | | [:like "Rajon Rondo"->"Ray Allen"@0] | | + | [:like "Tim Duncan"->"Tony Parker"@0] | | [:like "Dejounte Murray"->"Manu Ginobili"@0] | | [:like "Dwyane Wade"->"LeBron James"@0] | | [:like "Ray Allen"->"Rajon Rondo"@0] | | + | | | [:like "Dejounte Murray"->"Marco Belinelli"@0] | | [:like "Kyrie Irving"->"LeBron James"@0] | | | | + | | | [:like "Dejounte Murray"->"Russell Westbrook"@0] | | [:like "LeBron James"->"Ray Allen"@0] | | | | + | | | [:like "Dejounte Murray"->"Tony Parker"@0] | | [:like "Paul George"->"Russell Westbrook"@0] | | | | + | | | [:like "Marco Belinelli"->"Danny Green"@0] | | [:like "Russell Westbrook"->"Paul George"@0] | | | | + | | | [:like "Danny Green"->"LeBron James"@0] | | [:like "Yao Ming"->"Tracy McGrady"@0] | | | | + | | | [:like "Danny Green"->"Marco Belinelli"@0] | | | | | | + | | | [:like "Marco Belinelli"->"Tony Parker"@0] | | | | | | + | | | [:like "Tiago Splitter"->"Manu Ginobili"@0] | | | | | | + | | | [:like "Tony Parker"->"Manu Ginobili"@0] | | | | | | + | | | [: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: + | a | b | + | [("Tim Duncan")] | <[edge1]> | + | <[vertex2]> | <[edge2]> | + | <[vertex3]> | <[edge3]> | + | <[vertex4]> | <[edge4]> | + | <[vertex5]> | [] | + + Scenario: Get subgraph in a space which doesn't have edge schema + Given an empty graph + And create a space with following options: + | partition_num | 9 | + | replica_factor | 1 | + | vid_type | FIXED_STRING(20) | + And having executed: + """ + CREATE TAG IF NOT EXISTS person(name string); + """ + When try to execute query: + """ + INSERT VERTEX person VALUES "Tom":("Tom") + """ + Then the execution should be successful + When executing query: + """ + GET SUBGRAPH 1 STEPS FROM "Tom" YIELD vertices as nodes, edges as relationships + """ + Then the result should be, in any order, with relax comparison: + | nodes | relationships | + | [("Tom")] | [] | + | [] | [] | + Scenario: bidirect edge When executing query: """