MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / bound_node_names

Method bound_node_names

nodedb/src/engine/graph/pattern/ast.rs:213–232  ·  view source on GitHub ↗

Get all unique node variable names bound in the query.

(&self)

Source from the content-addressed store, hash-verified

211impl MatchQuery {
212 /// Get all unique node variable names bound in the query.
213 pub fn bound_node_names(&self) -> Vec<String> {
214 let mut names = Vec::new();
215 for clause in &self.clauses {
216 for chain in &clause.patterns {
217 for triple in &chain.triples {
218 if let Some(ref n) = triple.src.name
219 && !names.contains(n)
220 {
221 names.push(n.clone());
222 }
223 if let Some(ref n) = triple.dst.name
224 && !names.contains(n)
225 {
226 names.push(n.clone());
227 }
228 }
229 }
230 }
231 names
232 }
233
234 /// Get all unique edge variable names bound in the query.
235 pub fn bound_edge_names(&self) -> Vec<String> {

Callers 1

match_queryFunction · 0.80

Calls 3

containsMethod · 0.45
pushMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected