type_bridge.query.ast¶
ast
¶
Abstract Syntax Tree (AST) for TypeQL queries.
This module defines the structure of TypeQL queries as a tree of typed objects, decoupling query construction from string formatting.
FunctionCallValue
dataclass
¶
LiteralValue
dataclass
¶
ArithmeticValue
dataclass
¶
Bases: Value
A binary arithmetic operation that is itself a Value.
Supports TypeQL infix operators: +, -, *, /, %, ^
Constraint
dataclass
¶
HasConstraint
dataclass
¶
IsaConstraint
dataclass
¶
Pattern
dataclass
¶
EntityPattern
dataclass
¶
RelationPattern
dataclass
¶
SubTypePattern
dataclass
¶
AttributePattern
dataclass
¶
HasPattern
dataclass
¶
ValueComparisonPattern
dataclass
¶
OrPattern
dataclass
¶
IidPattern
dataclass
¶
Statement
dataclass
¶
RawStatement
dataclass
¶
HasStatement
dataclass
¶
IsaStatement
dataclass
¶
RelationStatement
dataclass
¶
Bases: Statement
Statement defining a relation and its role players.
For TypeDB 3.x inserts, relations don't use a variable prefix. Set include_variable=False for insert statements.
Attributes can be included inline for insert statements where the variable is not used (TypeDB 3.x: (role: $player) isa relation, has attr value;).
DeleteThingStatement
dataclass
¶
LetAssignment
dataclass
¶
Bases: QueryNode
Assignment in a match let clause.
Can be: - $x = func() (single value) - $x in func() (stream)
InsertClause
dataclass
¶
DeleteClause
dataclass
¶
UpdateClause
dataclass
¶
FetchAttribute
dataclass
¶
FetchVariable
dataclass
¶
FetchAttributeList
dataclass
¶
FetchFunction
dataclass
¶
Bases: FetchItem
Fetch a function result.
Generates: "key": func($var) Examples: iid($var), label($t)
FetchWildcard
dataclass
¶
FetchNestedWildcard
dataclass
¶
Bases: FetchItem
Fetch all attributes of a variable in a nested object.
Generates: "key": { $var.* }
This is used when you need to combine wildcard with other fetch items like label() and iid(), since TypeDB doesn't allow mixing $var.* with key-value pairs at the same level.
FetchClause
dataclass
¶
Bases: Clause
A fetch clause defining output structure.
Can contain either typed FetchItems or raw strings for backwards compatibility.
AggregateExpr
dataclass
¶
Bases: QueryNode
An aggregate expression like count($var) or sum($attr).
Generates: function($var) or function($var.attr)