MCPcopy Create free account
hub / github.com/GraphLite-AI/GraphLite / validate_basic_query_edge_patterns

Function validate_basic_query_edge_patterns

graphlite/src/ast/validator.rs:2126–2159  ·  view source on GitHub ↗
(query: &BasicQuery, errors: &mut Vec<ValidationError>)

Source from the content-addressed store, hash-verified

2124}
2125
2126fn validate_basic_query_edge_patterns(query: &BasicQuery, errors: &mut Vec<ValidationError>) {
2127 for pattern in &query.match_clause.patterns {
2128 for element in &pattern.elements {
2129 if let PatternElement::Edge(edge) = element {
2130 // Validate edge direction
2131 match edge.direction {
2132 EdgeDirection::Both => {
2133 // <-> is valid
2134 }
2135 EdgeDirection::Incoming => {
2136 // <- is valid
2137 }
2138 EdgeDirection::Outgoing => {
2139 // -> is valid
2140 }
2141 EdgeDirection::Undirected => {
2142 // -- is valid
2143 }
2144 }
2145
2146 // Validate edge labels
2147 for label in &edge.labels {
2148 if label.is_empty() {
2149 errors.push(ValidationError {
2150 message: "Edge label cannot be empty".to_string(),
2151 location: None,
2152 error_type: ValidationErrorType::Syntax,
2153 });
2154 }
2155 }
2156 }
2157 }
2158 }
2159}
2160
2161/// Validate temporal literals
2162fn validate_temporal_literals(_query: &Query, _errors: &mut Vec<ValidationError>) {

Callers 1

validate_edge_patternsFunction · 0.85

Calls 1

is_emptyMethod · 0.45

Tested by

no test coverage detected