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

Function validate_graph_expression

graphlite/src/ast/validator.rs:2411–2435  ·  view source on GitHub ↗

Validate graph expression

(
    graph_expr: &GraphExpression,
    _ctx: &mut ValidationContext,
    errors: &mut Vec<ValidationError>,
)

Source from the content-addressed store, hash-verified

2409
2410/// Validate graph expression
2411fn validate_graph_expression(
2412 graph_expr: &GraphExpression,
2413 _ctx: &mut ValidationContext,
2414 errors: &mut Vec<ValidationError>,
2415) {
2416 match graph_expr {
2417 GraphExpression::Reference(path) => {
2418 if path.segments.is_empty() {
2419 errors.push(ValidationError {
2420 message: "Graph reference path cannot be empty".to_string(),
2421 location: Some(path.location.clone()),
2422 error_type: ValidationErrorType::Semantic,
2423 });
2424 }
2425 }
2426 GraphExpression::Union { left, right, .. } => {
2427 validate_graph_expression(left, _ctx, errors);
2428 validate_graph_expression(right, _ctx, errors);
2429 }
2430 GraphExpression::CurrentGraph => {
2431 // CurrentGraph is valid - it refers to the session's current graph
2432 // No validation needed
2433 }
2434 }
2435}
2436
2437/// Validate match clause
2438fn validate_match_clause(

Callers 1

validate_from_clauseFunction · 0.85

Calls 2

cloneMethod · 0.80
is_emptyMethod · 0.45

Tested by

no test coverage detected