Expressions & Object Sets
A serializable expression AST for filters, computed properties, access control conditions, and composable entity collection queries.
Expr Variants
| Variant | Description |
|---|---|
| Literal | Constant PropertyValue |
| Property | PropertyRef (direct or via LinkHop traversal) |
| Compare | Eq, Ne, Lt, Le, Gt, Ge, Contains, StartsWith, EndsWith |
| Arithmetic | Add, Sub, Mul, Div, Mod |
| And / Or / Not | Boolean composition |
| Aggregate | Count, Sum, Avg, Min, Max, P95, P99, CountDistinct over an ObjectSet |
| IsNull | Null check |
| Cast | Type conversion to target PropertyType |
| Call | Server-side FunctionDef invocation |
| HasInterface | Check if entity implements an interface |
| Spatial | Geographic predicate on a GeoPoint/GeoShape property |
ObjectSet Queries
Composable, predicate-defined entity collections.
| Variant | Description |
|---|---|
| OfType(id) | All instances of an ObjectType |
| Implementing(id) | All types implementing an Interface |
| Filter | Base set + Expr predicate |
| Union / Intersect / Subtract | Set algebra |
| SearchAround | Graph traversal via HopDescriptor (link_type, direction, filter) |
| TextSearch | Full-text search with optional type filter |
| Explicit(ids) | Named set of InstanceIds |
Chaining
Rust
// "All HVAC units in zone A where temp > 28"
ObjectSet::of_type(hvac_id)
.filter(Expr::And(vec![
Expr::Compare {
left: Box::new(Expr::Property(PropertyRef::direct("zone"))),
op: CompareOp::Eq,
right: Box::new(Expr::Literal(PropertyValue::String("A".into()))),
},
Expr::Compare {
left: Box::new(Expr::Property(PropertyRef::direct("temperature"))),
op: CompareOp::Gt,
right: Box::new(Expr::Literal(PropertyValue::F64(28.0))),
},
])) Questions?
Reach out for help with integration, deployment, or custom domain codecs.