MCPcopy Create free account
hub / github.com/LadybugDB/ladybug / bindGraphPattern

Method bindGraphPattern

src/binder/bind/bind_graph_pattern.cpp:36–45  ·  view source on GitHub ↗

A graph pattern contains node/rel and a set of key-value pairs associated with the variable. We bind node/rel as query graph and key-value pairs as a separate collection. This collection is interpreted in two different ways. - In MATCH clause, these are additional predicates to WHERE clause - In UPDATE clause, there are properties to set. We do not store key-value pairs in query graph primarily be

Source from the content-addressed store, hash-verified

34// We do not store key-value pairs in query graph primarily because we will merge key-value
35// std::pairs with other predicates specified in WHERE clause.
36BoundGraphPattern Binder::bindGraphPattern(const std::vector<PatternElement>& graphPattern) {
37 auto queryGraphCollection = QueryGraphCollection();
38 for (auto& patternElement : graphPattern) {
39 queryGraphCollection.addAndMergeQueryGraphIfConnected(bindPatternElement(patternElement));
40 }
41 queryGraphCollection.finalize();
42 auto boundPattern = BoundGraphPattern();
43 boundPattern.queryGraphCollection = std::move(queryGraphCollection);
44 return boundPattern;
45}
46
47// Grammar ensures pattern element is always connected and thus can be bound as a query graph.
48QueryGraph Binder::bindPatternElement(const PatternElement& patternElement) {

Callers 1

Calls 4

BoundGraphPatternClass · 0.85
finalizeMethod · 0.45

Tested by

no test coverage detected