Documentation Language: Swift

Structure

AQLCollectionExpression

Represents collection operations in AQL (select, reject, collect, etc.).

struct AQLCollectionExpression

Overview

Collection operations allow filtering, transformation, and querying of collections in AQL expressions. These operations follow OCL semantics.

Supported Operations

Filtering

Transformation

Querying

Properties

Element Lookup

Example Usage

// Filter: persons->select(p | p.age > 18)
let adultsExpr = AQLCollectionExpression(
    source: personsExpr,
    operation: .select,
    iterator: "p",
    body: ageComparisonExpr
)

// Transform: persons->collect(p | p.name)
let namesExpr = AQLCollectionExpression(
    source: personsExpr,
    operation: .collect,
    iterator: "p",
    body: nameNavigationExpr
)

// Query: persons->size()
let sizeExpr = AQLCollectionExpression(
    source: personsExpr,
    operation: .size
)

Topics

Initializers

?
init(source:operation:iterator:body:)

Creates a collection operation expression.

Instance Properties

V
body

Optional body expression evaluated for each element.

V
iterator

Optional iterator variable name for operations that need it.

V
operation

The operation to perform.

V
source

The source collection expression.

Instance Methods

F
evaluate(in:)

Evaluates the expression within the specified execution context.

Enumerations

E
AQLCollectionExpression.Operation

Collection operation type.

Relationships

Conforms To

See Also

Expressions

P
AQLExpression

Protocol for AQL expressions that can be evaluated within an execution context.

S
AQLNavigationExpression

Represents property navigation (e.g., object.property or object.reference).

S
AQLLiteralExpression

Represents a literal value (String, Integer, Boolean, Real, null).

S
AQLVariableExpression

Represents a variable reference in AQL.

S
AQLLetExpression

Represents let expressions for local variable bindings in AQL.