| 188 | } |
| 189 | |
| 190 | void QueryGraph::addQueryNode(std::shared_ptr<NodeExpression> queryNode) { |
| 191 | // Note that a node may be added multiple times. We should only keep one of it. |
| 192 | // E.g. MATCH (a:person)-[:knows]->(b:person), (a)-[:knows]->(c:person) |
| 193 | // a will be added twice during binding |
| 194 | if (containsQueryNode(queryNode->getUniqueName())) { |
| 195 | return; |
| 196 | } |
| 197 | queryNodeNameToPosMap.insert({queryNode->getUniqueName(), queryNodes.size()}); |
| 198 | queryNodes.push_back(std::move(queryNode)); |
| 199 | } |
| 200 | |
| 201 | void QueryGraph::addQueryRel(std::shared_ptr<RelExpression> queryRel) { |
| 202 | if (containsQueryRel(queryRel->getUniqueName())) { |
no test coverage detected